Last active
December 15, 2015 11:29
-
-
Save jalogisch/5253010 to your computer and use it in GitHub Desktop.
Regading this posting on graylog2 ML https://groups.google.com/forum/?fromgroups=#!topic/graylog2/m_8LPw9IOD4
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 { | |
exec { | |
command => "ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{print $1}'" | |
interval => "86400" | |
type => "ipv4" | |
} | |
file { | |
format => "plain" | |
message_format => "plain" | |
type => "yum_log" | |
path => "/var/log/yum.log" | |
} | |
} | |
filter { | |
grok { | |
type => "yum_log" | |
pattern => [ "<%{POSINT:syslog_pri}>%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{PROG:syslog_program}(?:\[%{POSINT:syslog_pid}\])?(:)? %{GREEDYDATA:syslog_message}" ] | |
} | |
syslog_pri { | |
type => "yum_log" | |
} | |
date { | |
type => "yum_log" | |
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ] | |
} | |
mutate { | |
type => "yum_log" | |
exclude_tags => "_grokparsefailure" | |
replace => [ "@source_host", "%{syslog_hostname}" ] | |
replace => [ "@message", "%{syslog_message}" ] | |
} | |
mutate { | |
type => "yumlog" | |
remove => [ "syslog_hostname", "syslog_message", "syslog_timestamp" ] | |
} | |
grok { | |
type => "ipv4" | |
pattern => "%{IP:hostname_ip}" | |
} | |
} | |
output { | |
stdout { | |
debug => true | |
} | |
gelf { | |
type => "yum_log" | |
host => "10.1.6.205" | |
port => "12201" | |
chunksize => "1420" | |
sender => "%{@source_host}" | |
level => [ "INFO" ] | |
facility => "yum" | |
file => "%{@source_path}" | |
full_message => "%{@message}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment