hk-awil
(Daniel Ambauen)
January 6, 2017, 6:42am
1
Hello
I would like to add the node.name
value to an extra message field.
Is this value readable from inside of logstash?
I tried to use the node.name
like the host field: "fqdn" => "%{host}"
without success.
Dose anybody know how to access the node.name value?
This is my example:
input {
file {
path => "/var/log/xyz/service.log"
type => "xyz-daemon"
add_field => { "service-port" => "12345"
"service-name" => "my-service"
"fqdn" => "%{host}"
"node-name" => ????
}
}
Best Regards,
Daniel
eperry
(Ed)
January 7, 2017, 5:21pm
2
in 2.4 and probly 5.1 logstash there is a logstash CLI argument "--allow-env" which lets you reference Environment varables like HOSTNAME
https://www.elastic.co/guide/en/logstash/current/environment-variables.html
I do this for my tracking "HEARTBEATS" so I know which logstash's are running and which one need to be restarted
add_field => { "service-port" => "12345"
"service-name" => "my-service"
"fqdn" => "%{host}"
"node-name" => "${HOSTNAME}"
}
1 Like
hk-awil
(Daniel Ambauen)
January 9, 2017, 8:16am
3
Hi ed
Thank you very much for your suggestion. Short after I have written my question,
I dicided to use an environment variable to solve the problem
Regards,
Daniel
system
(system)
Closed
February 6, 2017, 8:17am
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.