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

Update documentation for logstash output with the correct defaults #10643

Closed
lahsivjar opened this issue Apr 12, 2023 · 5 comments · Fixed by #11165
Closed

Update documentation for logstash output with the correct defaults #10643

lahsivjar opened this issue Apr 12, 2023 · 5 comments · Fixed by #11165
Assignees
Labels
docs enhancement Team:Docs Label for the Observability docs team
Milestone

Comments

@lahsivjar
Copy link
Contributor

The current documentation for APM-Server indicates that with logstash output the default value of @metadata.beat to apm. However, if the value of the config output.logstash.index is not set then the default value is apm-server.

@lahsivjar lahsivjar added enhancement docs Team:Docs Label for the Observability docs team labels Apr 12, 2023
@lucabelluccini
Copy link
Contributor

lucabelluccini commented Jun 16, 2023

The documentation is also broken as I think the Logstash guide should contain the "new" APM data streams with the assets installed by APM Integration and not the apm-... indices.
We should switch to the data streams output.

In addition, it seems we send out:

	"data_stream.namespace"=>"default",
	"data_stream.type"=>"metrics",
	"data_stream.dataset"=>"apm.internal”,

This format in Logstash doesn't make it kick in the data stream auto routing. Users are obliged to use index => "%{[data_stream.type]}-%{[data_stream.dataset]}-%{[data_stream.namespace]} while they shouldn't.

Hello @simitt

  • the docs for Logstash output for APM Standalone is very outdated as we do not even write to the correct data streams.
  • on top of that, I think APM should use the "object" notation for data_stream.* fields in order to be able to use the data stream auto routing. But if we change it now, it might break for users who already adapted the pipeline to use the . - to be honest I've always thought Logstash was converting in field references both kind of notations, but it doesn't seem the case.

@simitt simitt added this to the 8.10 milestone Jun 20, 2023
@lucabelluccini
Copy link
Contributor

Just to add more context - I would expect APM Server standalone with Logstash output to be used as any other Elastic Agent integration and benefit from Data Stream auto routing https://www.elastic.co/guide/en/fleet/current/logstash-output.html

I find it odd that we need %{[data_stream.type]}-%{[data_stream.dataset]}-%{[data_stream.namespace]} only for APM.

@felixbarny
Copy link
Member

I agree but I think the solution is that the Logstash data stream auto routing takes into account dotted field names.

@lucabelluccini
Copy link
Contributor

For the best course of actions, I would propose the following workaround as:

  • it will work transparently
  • it will not break in case APM Server will start publishing the data_stream fields as objects
  • it will not affect Elastic Agent integrations sending data_stream fields as objects
input {
  elastic_agent {
    port => 5044
  }
}

filter {
mutate {
  rename => {
    "[data_stream.type]" => "[data_stream][type]"
    "[data_stream.dataset]" => "[data_stream][dataset]"
    "[data_stream.namespace]" => "[data_stream][namespace]"
  }
}
}
output {
  elasticsearch {
    hosts => ["http://localhost:9200"] 
    data_stream => "true"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs enhancement Team:Docs Label for the Observability docs team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants