Guest User

Untitled

a guest
Dec 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.48 KB | None | 0 0
  1. input {
  2.      beats {
  3.            port => 5000
  4.            ssl => true
  5.            ssl_certificate => "/logstash.crt"
  6.            ssl_key => "/logstash.key"
  7.            }
  8. }
  9.  
  10. filter {
  11.  
  12.     mutate { remove_field => ["[log][offset]", "[container][labels]", "[host][id]", "[host][architecture]", "[host][containerized]", "[host][os][family]", "[docker][container][labels][com_docker_compose_config-hash]", "[docker][container][labels][com_docker_compose_container-number]", "[docker][container][labels][com_docker_compose_oneoff]", "[docker][container][labels][com_docker_compose_version]", "[docker][container][labels][maintainer]", "[ecs][version]", "[agent]"] }
  13.  
  14.     if [container][image][name] =~ "nginx" {
  15.            remove_field => "message"
  16.     }
  17.  
  18.     mutate {
  19.        remove_tag => ["beats_input_codec_plain_applied"]
  20.        remove_tag => ["_geoip_lookup_failure"]
  21.     }
  22.   }
  23.  
  24.   if [container][image][name] !=~ "*nginx*" or [container][id] == "logs" {
  25.     prune { whitelist_names => [ "@timestamp", "host", "container", "message", "tags", "log" ]}
  26.   }
  27. }
  28.  
  29. output {
  30.      if [container][image][name] =~ "nginx" {
  31.         elasticsearch {
  32.                 hosts => "http://elasticsearch:9200"
  33.                 user => "system"
  34.                 password => '111111'
  35.                 ilm_enabled => true
  36.                 template_overwrite => true
  37.                 ilm_rollover_alias => "nginx"
  38.                 ilm_policy => "nginx"
  39.                 }
  40.         stdout { codec => json}
  41.      }
Advertisement
Add Comment
Please, Sign In to add comment