1

Currently I am getting messages from multiple sources into a single input. This all works fine and I can filter on specific sources. However the source names aren't really userfriendly, for example 4f5b4a8de2b9.

So the question is, is it possible to configure the logger to send a specific source or append something to the source so that they are more easily distinguishable and searchable?

For the reference I am using multiple wildfly servers that are restarted quite frequently, so the source tag is currently changed a lot.

munHunger
  • 2,572
  • 5
  • 34
  • 63

2 Answers2

0

I'm also using Wildfly and Graylog and ended up using this logger: http://logging.paluch.biz/examples/wildfly.html

This logger provides means to add static fields to each log entry with the "additionalFields" and "additionalFieldTypes" properties.

    <property name="additionalFields" value="fieldName1=fieldValue1,fieldName2=fieldValue2" />
    <property name="additionalFieldTypes" value="fieldName1=String,fieldName2=Double,fieldName3=Long" />

Add a fieldname with the desired value that makes it easier for you to search in GrayLog and choose the appropriate fieldType.

Chris
  • 958
  • 8
  • 19
0

Your source 4f5b4a8de2b9 looks like a docker container ID. Right? If you run docker inspect <container ID> you should see that the hostname property is automatically set to the container ID. Since it seems that graylog picks up hostname as source you should, if you are using docker compose for example...

...be able to easily set the internal hostname:

version: '3.7'
services:
  some-service:
    hostname: your_hostname
8DH
  • 2,022
  • 23
  • 36