简体   繁体   中英

Logstash cannot create index in ElasticSearch

I'm trying to create index in ElastisSearch with index as per following logstash configuration. Unfortunately, it was not creating index in ElasticSearch at all. Please let me know did I miss something to configure it. thanks.

output {
  if "my-service-1" in [tags] or "my-service-2" in [tags] {
    amazon_es {
      hosts => ["es-cluster.ap-southeast-1.es.amazonaws.com"]
      region => "ap-southeast-1"
      aws_access_key_id => ''
      aws_secret_access_key => ''
      index => "service-logging-%{+YYYY.MM}"
    }
  } else {
    amazon_es {
      hosts => ["es-cluster.ap-southeast-1.es.amazonaws.com"]
      region => "ap-southeast-1"
      aws_access_key_id => ''
      aws_secret_access_key => ''
      index => "%{[fields][custom_field_logfilename]}-%{+YYYY.MM}"
    }
  }
}

Firstly, try to use stdout output instead of amazon_es to check if you are able to create some events at the logstash level, then probably you gotta check for the logs at the amazon instance for the access or firewall issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM