Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- filter {
- if [type] == "mongostat" {
- grok {
- patterns_dir => "/etc/logstash/patterns"
- match => ["message","%{HOSTNAME:host}:%{INT:port} %{INSERT}%{QUERY}%{UPDATE}%{DELETE}%{GETMORE}%{SPACE}%{NUMBER:mongoCommand}\|%{NUMBER:mongoReplCommand}%{SPACE}%{NUMBER:mongoDirty}%{SPACE}%{NUMBER:mongoUsed}%{SPACE}%{NUMBER:mongoFlushes}%{SIZE}%{RES}%{SPACE}%{NUMBER:mongoQR}\|%{NUMBER:mongoQW}%{SPACE}%{NUMBER:mongoAR}\|%{NUMBER:mongoAW}%{NETIN}%{NETOUT}%{SPACE}%{NUMBER:mongoConnections}%{SPACE}%{NOTSPACE:mongoReplSet}%{SPACE}%{WORD:mongoReplMember}%{SPACE}%{TIME:mongoTime}"]
- }
- if [mongoNetInQualifier] == 'b' {
- ruby {
- code => "event['mongoNetInKB'] = event['mongoNetIn'].to_f / 1024"
- }
- }
- if [mongoNetInQualifier] == 'k' {
- ruby {
- code => "event['mongoNetInKB'] = event['mongoNetIn'].to_f * 1"
- }
- }
- if [mongoNetInQualifier] == 'm' {
- ruby {
- code => "event['mongoNetInKB'] = event['mongoNetIn'].to_f * 1024"
- }
- }
- if [mongoNetInQualifier] == 'g' {
- ruby {
- code => "event['mongoNetInKB'] = event['mongoNetIn'].to_f * 1048576"
- }
- }
- mutate {
- convert => { "mongoAW" => "integer" }
- convert => { "mongoAR" => "integer" }
- convert => { "mongoDirty" => "float" }
- convert => { "mongoSize" => "float" }
- convert => { "mongoUpdate" => "integer" }
- convert => { "mongoInsert" => "integer" }
- convert => { "port" => "integer" }
- convert => { "mongoNetIn" => "integer" }
- convert => { "mongoQR" => "integer" }
- convert => { "mongoConnections" => "integer" }
- convert => { "mongoRes" => "float" }
- convert => { "mongoGetmore" => "integer" }
- convert => { "mongoCommand" => "integer" }
- convert => { "mongoQuery" => "integer" }
- convert => { "mongoDelete" => "integer" }
- convert => { "mongoUsed" => "float" }
- convert => { "mongoNetOut" => "integer" }
- convert => { "mongoFlushes" => "integer" }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement