4

I'm working with rsyslog through multiple hops. What I want is the following, I do not want the short hostname in the msg I only want the IP. So the server sending the msg I do not want it to add its short hostname to the message being sent I only want the IP of the server.

I'm using RHEL 5.5 with rsyslog 3.22.1.3

Any ideas?

user52297
  • 41
  • 3
  • Somewhat related is http://serverfault.com/questions/26430/fqdns-during-migration-from-syslogd-to-syslog-ng – kubanczyk Nov 20 '12 at 18:26

1 Answers1

0

Add the below line in GLOBAL DIRECTIVES of rsyslog

$template LineTemplate,"%timereported% %fromhost-ip% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"

Then add below line just after the log file name

;LineTemplate

pranav
  • 11
  • 2