apache error log logstash grok pattern
# DataBase/Elasticsearch2021. 4. 14. 15:24apache error log logstash grok pattern

아파치 에러로그 [Sun Jan 31 16:07:40.266665 2021] [access_compat:error] [pid 14356] [client 18.183.46.74:50067] AH01797: client denied by server configuration: /DATA/darksharavim/html/xmlrpc.php grok filter 설정값 \[(?%{DAY:day} %{MONTH:month} %{MONTHDAY} %{TIME} %{YEAR})\] \[.*:%{LOGLEVEL:loglevel}\] \[pid %{NUMBER:pid}\] \[client %{IP:clientip}:.*\] %{GREEDYDATA:errormsg} 결과값 { "timestamp": [ "Sun Jan 3..

아파치 로그포맷 JSON 변경
# Web&WAS/Apache2021. 4. 1. 17:49아파치 로그포맷 JSON 변경

LogFormat "{ \"time\":\"%t\", \"clientip\":\"%a\",\"host\":\"%V\", \"request\":\"%U\", \"query\":\"%q\", \"method\":\"%m\", \"status\":\"%>s\", \"userAgent\":\"%{User-agent}i\", \"referer\":\"%{Referer}i\" }" json_format

아파치 GeoIP 설정 및 적용(centos5x)
# Web&WAS/Apache2020. 1. 30. 17:04아파치 GeoIP 설정 및 적용(centos5x)

설치환경 centos5.11 x86 apache-2.0.65 geoip api C라이브러리 설치 # unzip geoip-api-c-master.zip 압축해제후 bootstrap실행하면 아래와 같이 오류발생 autoreconf: Entering directory `.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 configure.ac:3: error: Autoconf version 2.63 or higher is required configure.ac:3: the top level autom4te: /usr/bin/m4 failed with exit status: 63 aclocal: aut..

아파치 internal dummy connection 로그 생성 방지
# Web&WAS/Apache2020. 1. 22. 10:50아파치 internal dummy connection 로그 생성 방지

아래와 같이 httpd.conf설정 SetEnvIf Remote_Addr "::1" is_exclude SetEnvIf Remote_Addr "127\.0\.0\.1" is_exclude CustomLog "|/usr/sbin/cronolog /weblog/%Y/%m/access-%Y%m%d.log" combined env=!is_exclude 아파치 재시작

아파치 GeoIP 설정 및 적용(centos7x)
# Web&WAS/Apache2020. 1. 17. 14:49아파치 GeoIP 설정 및 적용(centos7x)

설치환경 Centos7.7 apache-2.4.41 csv파일 다운로드(가입해야 다운가능) https://www.maxmind.com/en/accounts/current/people/current csv->dat 변환 # yum -y install python-ipaddr.noarch # git clone https://github.com/sherpya/geolite2legacy.git # ./geolite2legacy.py -i ../GeoLite2-Country-CSV_20200114.zip -f geoname2fips.csv -o GeoIP.dat 참고 : https://github.com/sherpya/geolite2legacy geoip C라이브러리 설치 # git clone https://gi..

image