Last active
August 29, 2015 14:02
-
-
Save danielmitd/32f5bd9e3d8cec5a2b53 to your computer and use it in GitHub Desktop.
apache combined log with cookie string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input { | |
| file { | |
| path => "/var/log/apache2/access.log" | |
| type => "apache-access-cookies" | |
| } | |
| } | |
| filter { | |
| if [type] == "apache-access-cookies" { | |
| grok { | |
| match => [ "message", "%{COMBINEDAPACHELOG} %{QS:cookie}" ] | |
| } | |
| date { | |
| match => [ "timestamp", "dd/MM/YYYY:HH:mm:ss Z"] | |
| } | |
| if [agent] != "" { | |
| useragent { source => "agent" } | |
| } | |
| geoip { | |
| source => "clientip" | |
| } | |
| kv { | |
| source => "cookie" | |
| target => "cookies" | |
| trim => "\"; " | |
| trimkey => "\"" | |
| remove_field => [ "cookie" ] | |
| } | |
| } | |
| } | |
| output { | |
| stdout { } | |
| elasticsearch { | |
| host => localhost | |
| flush_size => 50 | |
| protocol => http | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <VirtualHost *:80> | |
| LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" \"%{Cookie}i\"" combinedcookie | |
| CustomLog /var/log/apache2/fudosan_access.log combinedcookie | |
| </VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment