Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing instructions about different indices when using logstash output #1631

Closed
JCMais opened this issue Dec 10, 2018 · 1 comment · Fixed by #2691
Closed

Missing instructions about different indices when using logstash output #1631

JCMais opened this issue Dec 10, 2018 · 1 comment · Fixed by #2691

Comments

@JCMais
Copy link

JCMais commented Dec 10, 2018

Following the format the data is sent when using the elasticsearch output directly, as seen here:

https://github.com/elastic/apm-server/blob/6.5/apm-server.yml#L409-L431

The docs for the logstash output are not correct: https://www.elastic.co/guide/en/apm/server/current/logstash-output.html

There is no message saying that it should forward the data based on the process.event value.

Here is a logstash.conf that takes that into consideration, and works for other beats components:

input {
  beats {
    port => 5044
  }
}

filter {
  if [@metadata][beat] == "apm-server" {
    if [processor][event] == "sourcemap" {
      mutate { add_field => { "[@metadata][index]" => "apm-%{[@metadata][version]}-sourcemap" } }
    } else {
      mutate { add_field => { "[@metadata][index]" => "apm-%{[@metadata][version]}-%{[processor][event]}-%{+yyyy.MM.dd}" } }
    }
  } else {
    mutate { add_field => { "[@metadata][index]" => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}" } }
  }
}

output {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    index => "%{[@metadata][index]}"
  }
}
@alvarolobato
Copy link

Related to: #1792

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants