I currently have a templated collector sidecar config to collect system logs that is applied to all our servers. I now have a server where I want to get both the system logs and the web logs from and via two different inputs because I want to use different extractors for each type of log.
I found this previous post that says seems to say it is possible to have different inputs from the same server but I was wondering if they can be to different collector configurations so that we can extract the logs differently? Also if anyone has an example config file that would allow for this?
Isn’t this just a simple case of defining a new collector configuration? This defines a new tag and the desired input sources (files, eventlog) and the desired output targets (BEATS receiver) for the config. You can then simply add the tag to the host’s Sidecar config file. And presto! You’re done!
Yes, you can have different collectors or you can do the both in the same config.
For simplicity, you can create another collector filebeat and, configure it to read the web logs and send it to graylog.
I don’t have a sample, but search on the forums. I am sure you will get some examples.
It depends on what you specifically mean by “configuration”. Because as @v_2nas says: one Sidecar can be subscribed to many Graylog tags, with each tag providing specific FileBeat and WinLogBeat configurations.
I don’t think I’ve been very precise with my language so far so I’m going to write out the components I have at the moment and then hopefully you’ll be able to see where I’m getting confused:
1 Web Server with a single sidecar
2 Graylog Server inputs each with their own port associated (1 for system logs, 1 for web logs)
There are two separate inputs so that each input can have its own extractor definition for differing analysis
2 Collector Sidecar Configurations each with their own tag associated (1 for the system logs, 1 for web logs)
Each configuration has an output linked with the relevant graylog input above
Each configuration also has an input pointing to the logs location of the web server
I tried doing this with two beats inputs but I don’t get any logs appearing from the input for the web logs. All the logs for both system and web appear under the system logs input, which means I can’t use a separate extractor for the web logs.
I may have something incorrectly configured but I’m fairly certain everything is fine.
I’ve also tried using NXLog instead of beats to see if that works but now I don’t get the web logs at all even on the system graylog input stream.
Thanks for the help with this and I apologise if I’m not using the correct names for everything.
The use-case you’re describing really should work. It is definitely possible to define a config that does what you want. So now we’re down to troubleshooting
Just as a side note, I found the reference documentation that says that filebeat can’t send to multiple outputs which is why we are using NXlog now:
You configure Filebeat to write to a specific output by setting options in the output section of the filebeat.yml config file. Only a single output may be defined.
@jan if I want to be able to send to multiple outputs so that I can do different extractors for each set of logs I should use nxlog instead of filebeat?