Created
June 28, 2018 05:00
-
-
Save abhishekraj2506/83c9d92f20f6421f04a3ab8bbca72d63 to your computer and use it in GitHub Desktop.
This file contains 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
{ | |
"description": "Pipeline for parsing Nginx access logs. Requires the geoip and user_agent plugins.", | |
"processors": [ | |
{ | |
"grok": { | |
"field": "message", | |
"patterns": [ | |
"%{IPORHOST:nginx.access.remote_ip} - %{DATA:nginx.access.user_name} \\[%{HTTPDATE:nginx.access.time}\\] \"%{WORD:nginx.access.method} %{DATA:nginx.access.url} HTTP/%{NUMBER:nginx.access.http_version}\" %{NUMBER:nginx.access.response_code} %{NUMBER:nginx.access.body_sent.bytes} \"%{DATA:nginx.access.referrer}\" \"%{DATA:nginx.access.agent}\"" | |
], | |
"ignore_missing": true | |
} | |
}, | |
{ | |
"remove": { | |
"field": "message" | |
} | |
}, | |
{ | |
"rename": { | |
"field": "@timestamp", | |
"target_field": "read_timestamp" | |
} | |
}, | |
{ | |
"date": { | |
"field": "nginx.access.time", | |
"target_field": "@timestamp", | |
"formats": [ | |
"dd/MMM/YYYY:H:m:s Z" | |
] | |
} | |
}, | |
{ | |
"remove": { | |
"field": "nginx.access.time" | |
} | |
}, | |
{ | |
"user_agent": { | |
"field": "nginx.access.agent", | |
"target_field": "nginx.access.user_agent" | |
} | |
}, | |
{ | |
"remove": { | |
"field": "nginx.access.agent" | |
} | |
}, | |
{ | |
"geoip": { | |
"field": "nginx.access.remote_ip", | |
"target_field": "nginx.access.geoip" | |
} | |
} | |
], | |
"on_failure": [ | |
{ | |
"set": { | |
"field": "error", | |
"value": "{{ _ingest.on_failure_message }}" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment