Hello I have configured collectd on all my devices (running Linux).
The configuration is:
/etc/collectd.conf
LoadPlugin cpu
LoadPlugin interface
LoadPlugin df
<Plugin network>
server "10.2.9.35" "5555"
/Plugin
My logstate configuration on the server (10.2.9.35) is
/etc/logstash/conf.d/collectd.conf:
input {
udp {
port => 3333 # 25826 matches port specified in collectd.conf
buffer_size => 1452 # 1452 is the default buffer size for Collectd
codec => collectd { } # specific Collectd codec to invoke
type => collectd
}
}
output {
elasticsearch { hosts => ["localhost:9200"] }
stdout { codec => rubydebug }
}
The syslog file on the server gets this type of messages:
Apr 30 19:04:00 linux-small logstash[11037]: {
Apr 30 19:04:00 linux-small logstash[11037]: "@timestamp" => 2022-05-01T02:04:00.556Z,
Apr 30 19:04:00 linux-small logstash[11037]: "value" => 1612136448.0,
Apr 30 19:04:00 linux-small logstash[11037]: "plugin" => "df",
Apr 30 19:04:00 linux-small logstash[11037]: "collectd_type" => "df_complex",
Apr 30 19:04:00 linux-small logstash[11037]: "@version" => "1",
Apr 30 19:04:00 linux-small logstash[11037]: "type_instance" => "used",
Apr 30 19:04:00 linux-small logstash[11037]: "type" => "collectd",
Apr 30 19:04:00 linux-small logstash[11037]: "host" => "petalinux",
Apr 30 19:04:00 linux-small logstash[11037]: "plugin_instance" => "data",
Apr 30 19:04:00 linux-small logstash[11037]: }
My question is how I can extract the source IP address?