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

docs: update Logstash output docs #11165

Merged
merged 6 commits into from
Jul 24, 2023
Merged

docs: update Logstash output docs #11165

merged 6 commits into from
Jul 24, 2023

Conversation

bmorelli25
Copy link
Member

@bmorelli25 bmorelli25 commented Jul 7, 2023

Summary

  • Updates the default value of @metadata.beat to apm-server
  • Removes the default value of @metadata.pipeline. This was previously documented as apm, however, when I set up Logstash and used stdout { codec => rubydebug { metadata => true } to output @metadata, I only saw the following:
  "@metadata"=>{
    "version"=>"8.8.2",
    "input"=>{
      "beats"=>{
        "host"=>{
          "ip"=>"0:0:0:0:0:0:0:1"
        }
      }
    },
    "beat"=>"apm-server",
    "type"=>"_doc"
  }

Documentation preview

View a preview of these changes by clicking here.

Resources

@mergify
Copy link
Contributor

mergify bot commented Jul 7, 2023

This pull request does not have a backport label. Could you fix it @bmorelli25? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-7.x is the label to automatically backport to the 7.x branch.
  • backport-7./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Jul 7, 2023
@apmmachine
Copy link
Contributor

apmmachine commented Jul 7, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-07-24T16:01:49.587+0000

  • Duration: 6 min 4 sec

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate and publish the docker images.

  • /test windows : Build & tests on Windows.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Comment on lines 186 to 188
In addition to @metadata, APM Server provides other potentially useful fields, like the
`processor.event` field and `data_stream` fields, which can be used to conditionally operate on
{apm-guide-ref}/data-model.html[event types], namespaces, or datasets.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewers: I removed the custom index example because it was outdated. It would be great to come up with a new example to provide here. What is a common use-case you see with Logstash?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe using logstash for routing events to different data streams can still be a fair use case; e.g. routing all metrics events to the same metrics datastream, rather than to service specific ones for custom metrics.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I was able to get this working with the following config. I've updated the documentation to match.

output {
  if [@metadata][beat] == "apm-server" {
    if [processor][event] == "metric" {
      elasticsearch {
        index => "%{[data_stream][type]}-custom-%{[data_stream][namespace]}"
        action => "create"
        cloud_id => "${CLOUD_ID}"
        cloud_auth => "${CLOUD_AUTH}"
      }
    } else {
      elasticsearch {
        data_stream => "true"
        cloud_id => "${CLOUD_ID}"
        cloud_auth => "${CLOUD_AUTH}"
      }
    }
  }
}
Screenshot 2023-07-13 at 3 04 24 PM

@bmorelli25 bmorelli25 self-assigned this Jul 7, 2023
@bmorelli25 bmorelli25 added backport-8.8 Automated backport with mergify backport-8.9 Automated backport with mergify and removed backport-skip Skip notification from the automated backport with mergify labels Jul 7, 2023
@bmorelli25 bmorelli25 requested review from lucabelluccini and a team July 7, 2023 22:45
Copy link
Contributor

@simitt simitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!
Waiting with approval until the bit for the @metadata or processor.event use case is finalised.

Comment on lines 186 to 188
In addition to @metadata, APM Server provides other potentially useful fields, like the
`processor.event` field and `data_stream` fields, which can be used to conditionally operate on
{apm-guide-ref}/data-model.html[event types], namespaces, or datasets.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe using logstash for routing events to different data streams can still be a fair use case; e.g. routing all metrics events to the same metrics datastream, rather than to service specific ones for custom metrics.

@bmorelli25 bmorelli25 requested a review from simitt July 13, 2023 22:05
@dmathieu dmathieu merged commit 448874c into elastic:main Jul 24, 2023
3 checks passed
mergify bot pushed a commit that referenced this pull request Jul 24, 2023
* docs: update ls docs

* Add custom metric example

---------

Co-authored-by: Silvia Mitter <silvia.mitter@elastic.co>
(cherry picked from commit 448874c)
mergify bot pushed a commit that referenced this pull request Jul 24, 2023
* docs: update ls docs

* Add custom metric example

---------

Co-authored-by: Silvia Mitter <silvia.mitter@elastic.co>
(cherry picked from commit 448874c)
mergify bot added a commit that referenced this pull request Jul 24, 2023
* docs: update ls docs

* Add custom metric example

---------

Co-authored-by: Silvia Mitter <silvia.mitter@elastic.co>
(cherry picked from commit 448874c)

Co-authored-by: Brandon Morelli <brandon.morelli@elastic.co>
mergify bot added a commit that referenced this pull request Jul 24, 2023
* docs: update ls docs

* Add custom metric example

---------

Co-authored-by: Silvia Mitter <silvia.mitter@elastic.co>
(cherry picked from commit 448874c)

Co-authored-by: Brandon Morelli <brandon.morelli@elastic.co>
@bmorelli25 bmorelli25 deleted the ls-docs branch July 25, 2023 01:12
bmorelli25 added a commit to bmorelli25/apm-server that referenced this pull request Sep 5, 2023
* docs: update ls docs

* Add custom metric example

---------

Co-authored-by: Silvia Mitter <silvia.mitter@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.8 Automated backport with mergify backport-8.9 Automated backport with mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update documentation for logstash output with the correct defaults
4 participants