NLog integration with Beats

Hi,
In my current application i am looking to get the application logs which use NLog into elasticsearch using logstash, There seems to have been quite a few changes around lumberjack now been replaced by beats etc. So wondering if anyone knows on how this can be done or has already tried it. I am new to ELK so just wanting some help

It seems in your case you are interested in Filebeat which is a lightweight log file shipper. It can send the log files to Logstash or Elasticsearch. Can you tell us a little bit more about your current setup?

As long as NLog does not write to files, there is no direct integration with Filebeat itself.

Currently Nlog is set up to write logs to a sql server instance but what i am looking for is those logs directed to logstash into elasticsearch. So i was looking for some mechanism like perhaps UDP/TCP using beat which i can configure Nlog to send the log messages to. I thought about FileBeat but it seemed more relevant if nlog wrote to text files?

Yeah, as the name implies Filebeat reads text files. Logstash can receive messages via UDP or TCP but I'm not aware of any Beat-based program that does that.

I recommend writing logs to disk since it creates a natural buffering mechanism. If you want to send over the network directly from your application there are so many more things that can go wrong, and when things go wrong you don't want to lose your logs.

1 Like