How can I show the log path as a field for each message in Graylog?

I want to include the full file path of each log message as a field in Graylog. For example, if a log message comes from /var/log/apache2/access.log, this path should be included as a field in the log message in Graylog.

(e.g., application_name, facility, level, log_path?).

Is there any solution available? thanks

Hey @marno

You can either use a Regex extractor or Pipeline. Pipeline is preferred.

Thank you so much for your reply!

I have been testing out to get the solution with a pipeline working. Iā€™m trying to match with a predefined value. The issue with this approach is that if you have custom paths, e.g., 30 different log files to applications, it will require a lot of pipeline rules as I understand?

I have not done that with 30 application. Maybe one or two but If you filter them out and apply a new field to each application, I believe it possible with one pipeline

I will give it a try, thanks @gsmith

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.