Search code examples
logstash-configuration

Logstash authentication


I'm setting up a logstash cluster and I configured some authentication regarding the output filter. However I can't figure out why it isn't working...

I tried brackets, no brackets, IP, FQDN...

input {
  tcp {
    port => 5000
    type => syslog
  }
  udp {
    port => 5000
    type => syslog
  }
}

filter {
  if [type] == "syslog" {
    grok {
      match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
      add_field => [ "received_at", "%{@timestamp}" ]
      add_field => [ "received_from", "%{host}" ]
    }
     date {
      match => [ "syslog_timestamp", "MMM  d HH:mm:ss", "MMM dd HH:mm:ss" ]
    }
  }
}

output {
  elasticsearch { hosts => ["localhost.enedis.fr:9200"] }
  user = sec-svc-log01
  password => 3N3D1S!!
  stdout { codec => rubydebug }
}

Am I missing something ? Thanks for your help !


Solution

  • Try using below ouput section code,

    output {
      elasticsearch { 
      hosts => ["localhost.enedis.fr:9200"]
      user => "sec-svc-log01"
      password => "3N3D1S!!"
     }
      stdout { codec => rubydebug }
    }