Hi All,
Can you please help me with the query.
My requirement is :
- i have to collect the metrics using Collectd .Metrics like (cpu,memory and process)
- After getting this metrics in collectd.json.log (collected generated this logstash file)
3.I have parsed this file as input in logstash config file and i have applied grok filters
logstash conf file:
input {
file {
path => "/var/log/collectd.json.log"
codec => "json"
sincedb_path => "/dev/null"
start_position => "beginning"
}
}
filter {
grok {
match => { "message" => "%{WORD:message}%{NOTSPACE:plugin_load }%{DATA:method}%{WORD:plugin}%{DATA:method}%{WORD:stats}%{GREEDYDATA:info}%{LOGLEVEL:info}%{NOTSPACE:}%{TIMESTAMP_ISO8601:time}" }
add_tag => [ "Collectd_Stats", "Collectd_logs" ]
}
}
output {
graphite {
host => "localhost"
port => "2003"
metrics => { "Metrics.XYZ.TEST.%{cpu}" => "%{stats}" }
metrics => { "Metrics.QLX.TEST.memory" => "%{stats}" }
}
stdout {
codec => "rubydebug"
}
}
4. In graphite, i can see the directory structure created but i don't see any values or metrics.
5.
Grok Filter applied on the below:
{"message":"plugin_load: plugin "apache" successfully loaded.","level":"info","@timestamp":"2020-03-06T10:51:37Z"}
{"message":"plugin_load: plugin "cpu" successfully loaded.","level":"info","@timestamp":"2020-03-06T10:51:37Z"}
{"message":"plugin_load: plugin "df" successfully loaded.","level":"info","@timestamp":"2020-03-06T10:51:37Z"}
{"message":"plugin_load: plugin "disk" successfully loaded.","level":"info","@timestamp":"2020-03-06T10:51:37Z"}
{"message":"plugin_load: plugin "memory" successfully loaded.","level":"info","@timestamp":"2020-03-06T10:51:37Z"}
Kindly help me to solve this issue.