C
C
CryptoSSH2019-04-10 15:08:44
Windows
CryptoSSH, 2019-04-10 15:08:44

How to configure output plugin in logstash config file?

Have a good mood.
I'm reading the logstash documentation, but I can't figure out how to implement my task.
logstash receives messages from rabbitmq, then the output plugin setting in the configuration file sends it to elasticsearch. I need to filter the messages included in logstash according to certain criteria (for example, serenity: *) and write them to a separate file. In this case, it is necessary to save all the messages that came to logstash and transfer them to elasticsearch. That is, what fell under the filter is sent to a file and to elasticsearch in a place with others that did not fall under the filter.

output  {
  if [message] =~ ".*serenity*." {
    file { 
      path => "e:\logs\log_serenity.log" 
    }
        }
  elasticsearch {
    hosts => "127.0.0.1"
  }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question