How to maintain the log source host using logstash

Posted by Ray Rodriguez on Server Fault See other posts from Server Fault or by Ray Rodriguez
Published on 2012-04-13T20:27:13Z Indexed on 2012/11/03 17:06 UTC
Read the original article Hit count: 391

Filed under:
|
|
|

I am following the steps in this blog to set up rsyslog + logstash + graylog2 and I can't figure out how to replace the @source_host attribute in logstash using the mutate -> replace filter.

In the exmaple the author replaces his @source_host with a string value but I'd like to use the actual value that is parsed from in this case a syslog.

mutate {
  type => loc1
  replace => ["@source_host", "loc1"]
}
mutate {
  type => loc2
 replace => ["@source_host", "loc2"]
}

How do I actually maintain the original source host in my logs?

© Server Fault or respective owner

Related posts about logging

Related posts about syslog