Hi Jan,
Please find the clear details …
Below is my input:
{“tags”:[“smartdata”,“metrics”,“beats_input_raw_event”],“event”:{“duration”:132692,“module”:“system”,“dataset”:“system.network”},“fields”:{“env”:“staging”},“metricset”:{“name”:“network”},“system":{“network”:{“in”:{“errors”:0,“bytes”:4888679808,“dropped”:0,“packets”:6557203},“out”:{“errors”:0,“bytes”:4888679808,“dropped”:0,“packets”:6557203},“name”:“lo”}},“service”:{“type”:“system”},”@version":“1”,“@timestamp”:“2019-06-28T03:54:12.179Z”,“ecs”:{“version”:“1.0.0”},“cloud”:{“instance”:{“name”:“graylog”,“id”:“8712523612341637729”},“machine”:{“type”:“n1-standard-1”},“project”:{“id”:“seventh-vigil-226207”},“availability_zone”:“asia-south1-c”,“provider”:“gcp”},“host”:{“architecture”:“x86_64”,“name”:“graylog”,“id”:“c1a04cd37d5cff9be8d129a366cb7fba”,“containerized”:false,“hostname”:“graylog”,“os”:{“name”:“Ubuntu”,“family”:“debian”,“version”:“16.04.5 LTS (Xenial Xerus)”,“kernel”:“4.15.0-1032-gcp”,“platform”:“ubuntu”,“codename”:“xenial”}},“agent":{“hostname”:"graylog”,“type”:“metricbeat”,“ephemeral_id”:“ea853894-c7c1-42b6-9a05-cfd245ad238d”,“id”:“6f264b40-0604-4564-8f80-199d3beab583”,“version”:“7.2.0”}}
Bold values i am going to fetch and assign to new name in my pipeline
below is my pipeline rule:
rule “metricdata”
when
has_field(“message”)
then
let json = parse_json(to_string($message.message));
let json_fields = select_jsonpath(json, {HOST: “$.agent_hostname”});
set_field(“HOST”, to_string(json_fields.HOST));
let json_fields = select_jsonpath(json, {NetworkData: “$.system_network_in_bytes”});
set_field(“NetworkData”, to_double(json_fields.NetworkData))
end
Expected result is
HOST=graylog
NetworkData = 4888679808
but i am getting no HOST ,in NetworkData value become 0
Can help me to resolve .why i cant get those values from input,where i am doing mistake.
Thanks,
Jay’