Hello
Is there a way in NLS to capture and display the original file name (and path) of the log file being collected? I am using the default rsyslog collector and I was wondering if I have to adjust the input or if I can modify the filter specific to the program.
Thanks.
capturing log file name from the filter?
Re: capturing log file name from the filter?
I don't believe remote (r)syslog entries contain the file name:
http://stackoverflow.com/questions/9209 ... age-format
So unless the message contains the file name, I am not aware of a way to retrieve this.
http://stackoverflow.com/questions/9209 ... age-format
So unless the message contains the file name, I am not aware of a way to retrieve this.
Former Nagios employee
Re: capturing log file name from the filter?
Hi. Thanks for the reply. I thought I could get it from the rsyslog.d/conf file itself. It has the InputFileName (as well as InputFileTage) in the configuration.
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: capturing log file name from the filter?
There is no log file associated with a remote log stream. In our human brains we create an association, but there really isn't one. You could potentially send ALL logs to a remote NLS without ever writing a related file. Does that make sense?
There is no correlation between the files being written on the host and the stream being sent to NLS.
There is no correlation between the files being written on the host and the stream being sent to NLS.
Re: capturing log file name from the filter?
In addition to what jdalrymple said, can you please explain the reason why you're looking for the file name/path? Perhaps we could help you out - I don't think that rsyslod has that built-in functionality without a massive amount of tinkering.
Re: capturing log file name from the filter?
Thanks for the replies. jdalrymple, what you're saying makes sense. jolson, I understand that rsyslog would not support this without modification.
To answer jolson's question - I would like the name and path of my log files because we man tomcat applications that log separately, in separate sandboxes, that log very similar data. I suspect the way to address this (if we really wanted to have the name and path) is to add that information to the log itself.
Thanks again to both of you.
To answer jolson's question - I would like the name and path of my log files because we man tomcat applications that log separately, in separate sandboxes, that log very similar data. I suspect the way to address this (if we really wanted to have the name and path) is to add that information to the log itself.
Thanks again to both of you.
Re: capturing log file name from the filter?
That would definitely be the easiest way to approach this. If you need help after you add the 'path' to the log files, we can help you construct a filter to retrieve that information. Let us know - thanks!