Display two service logs of same server seperatly in graylog UI

suppose I have two services (e.g service1 and service2) running on same server.
both services generates logs
In graylog how we can display both the service logs seperatly in graylog UI?

In my case I have used sidecar and filebeat for collecting logs from server
please suggest me the best possible way for it

In the filebeat configuration you can set a specific marker field for each log. See this recent post.

1 Like

so can we edit our filebeat configuration as follows for two services?

filebeat.inputs:

  • input_type: log
    enabled: true
    fields:
    service_name: service1
    paths:
    • /var/logs/service1.log
      type: log
  • input_type: log
    enabled: true
    fields:
    service_name: service2
    paths:
    • /var/logs/service2.log
      type: log

That generally looks OK as a snippet… if you use the formatting tools when you post code in this forum it will be easier to tell… remember the configuration file is sensitive to indentation.

1 Like

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