Created
February 26, 2019 08:32
-
-
Save bhatikuldeep/f3e27d93c3e7f0eab27ebfa137c53abd to your computer and use it in GitHub Desktop.
Sample Logstash Configuration File - to log messages from Apigee Edge to ELK stack
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
input { | |
tcp { | |
port => 5044 | |
type => syslog | |
} | |
} | |
filter { | |
mutate { | |
gsub => [ | |
"message", "[\u0000]", "" | |
] | |
remove_field => ["timestamp", "host", "facility_label", "severity_label", "severity", "facility", "priority"] | |
} | |
grok { | |
match => {"message" => "<%{NUMBER:priority_index}>%{DATESTAMP_OTHER:apigeeTimestamp}%{LOGLEVEL}: %{GREEDYDATA:apigeeMessage}"} | |
remove_field => ["message"] | |
} | |
json { | |
source => "apigeeMessage" | |
target => "message" | |
remove_field => ["apigeeMessage"] | |
} | |
} | |
output { | |
#added below line to see how the message is outputed/parsed with logstash filer, you can remove below line (only stdout { codec => rubydebug }), if necessary. | |
stdout { codec => rubydebug } | |
elasticsearch { | |
hosts => ["http://localhost:9200"] | |
index => "apigee-%{+YYYY.MM.dd}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment