-
-
Save shahariaazam/d871082475877d112d4ed0ed4c34af41 to your computer and use it in GitHub Desktop.
Parse MongoDB logs in logstash
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
filters { | |
grok { | |
type => "mongodb" | |
pattern => [ "%{DATA:mongo_ts} \[%{DATA:mongo_conn}\]? %{DATA:mongo_type} %{GREEDYDATA:mongo_message}" ] | |
} | |
mutate { | |
type => "mongodb" | |
replace => [ "@message", "%{mongo_message}" ] | |
} | |
grok { | |
type => "mongodb" | |
match => [ "mongodb_conn", "query|command|getmore" ] # list of mongo commands with k:v pairs | |
pattern => [ "%{DATA:mongo_collection} %{GREEDYDATA:mongo_details} %{NUMBER:mongo_time:int}ms" ] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment