Skip to content

Improve reference docs that describe how to set options dynamically#8290

Merged
dedemorton merged 4 commits intoelastic:masterfrom
dedemorton:issue#3227
Sep 25, 2018
Merged

Improve reference docs that describe how to set options dynamically#8290
dedemorton merged 4 commits intoelastic:masterfrom
dedemorton:issue#3227

Conversation

@dedemorton
Copy link
Copy Markdown
Contributor

Closes issue #3227

There's been some confusion about how some of the settings under indices (like mappings and default) work in the ES output. Since other settings (like pipelines) use the same data structures, I've applied my updates to those descriptions, too.

Please suggest a good example to use for the topics section.

Also let me know if the examples I've added are too contrived. I'm open to adding better examples, but mainly wanted to clarify how the settings work.

@dedemorton dedemorton added docs review needs_backport PR is waiting to be backported to other branches. labels Sep 11, 2018
------------------------------------------------------------------------------
output.elasticsearch:
hosts: ["http://localhost:9200"]
index: "%\{[fields.log_type]\}-%\{[beat.version]\}-%\{+yyyy.MM.dd}\"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps it would be nice to explain that it's always recommended to include beat.version here to avoid mapping issues on upgrades?

Copy link
Copy Markdown
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

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

This is looking good, I left a comment on index overriding

@dedemorton
Copy link
Copy Markdown
Contributor Author

@exekias Can you review the change I pushed and let me know if anyone else needs to review this. Thanks!

Copy link
Copy Markdown
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

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

PR looks good to me, I'm afraid I'm not familiar enough with this to provide a meaninful example for kafka output.

Maybe @ph can chime in?

Copy link
Copy Markdown
Contributor

@ph ph left a comment

Choose a reason for hiding this comment

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

thanks @exekias for the ping, I've looked at the implementation, and we are using mappings in the code, the examples were using the right key but the asciidoc were using mapping.

Everything else look good.

- index: "%{[fields.log_type]}"
mappings:
"critical": "sev1"
"normal": "sev2"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is no need to have quotes for mappings.

 critical: "sev1"
 normal: "sev2"

- pipeline: "%{[fields.log_type]}"
mappings:
"critical": "sev1_pipeline"
"normal": "sev2_pipeline"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same comment as above

references, such as `%{[fields.name]}`, the fields must exist, or the rule fails.

*`mapping`*: Dictionary mapping index names to new names
*`mapping`*:: A dictionary that takes the value returned by `index` and maps it
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/mapping/mappings/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch! I fixed it in the code, but not the descriptions.

references, such as `%{[fields.name]}`, the fields must exist, or the rule
fails.

*`mapping`*:: A dictionary that takes the value returned by `pipeline` and maps
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/mapping/mappings/

references, such as `%{[fields.name]}`, the fields must exist, or the rule
fails.

*`mapping`*:: A dictionary that takes the value returned by `topic` and maps it
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/mapping/mappings/

fails.

*`mapping`*: Dictionary mapping key values to new names
*`mapping`*: A dictionary that takes the value returned by `key` and maps it to
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/mapping/mappings/

@dedemorton
Copy link
Copy Markdown
Contributor Author

@ph I've fixed the issues that you noticed (see 3a33035). Do you have any ideas for a Kafka example that I can add here: https://github.com/elastic/beats/pull/8290/files#diff-f1a89e6c3a1ce6f296f47ad83b989ff7R872

@ph
Copy link
Copy Markdown
Contributor

ph commented Sep 24, 2018

@dedemorton LGTM

@dedemorton dedemorton merged commit eb6ab40 into elastic:master Sep 25, 2018
@dedemorton dedemorton deleted the issue#3227 branch October 1, 2018 23:34
@dedemorton dedemorton removed the needs_backport PR is waiting to be backported to other branches. label Oct 1, 2018
dedemorton added a commit to dedemorton/beats that referenced this pull request Oct 17, 2018
…lastic#8290)

* Improve Elasticsearch output docs about indices, pipelines, and keys settings

* Updates from review

* Change setting name from mapping to mappings

* Remove note to reviewer
dedemorton added a commit that referenced this pull request Oct 18, 2018
…8478) (#8529)

* Clarify support for ssl options for modules (#7967)

* Clarify support for ssl options for modules

* Change example to show http module

* Update Elasticsearch module examples to show http in the URL (#8226)

* Improve reference docs that describe how to set options dynamically (#8290)

* Improve Elasticsearch output docs about indices, pipelines, and keys settings

* Updates from review

* Change setting name from mapping to mappings

* Remove note to reviewer

* Fix conditional coding (#8446)

* Suppress dashboard info when dashboards aren't available (#8395)

* Clarify add_docker_metadata docs (#8478)
dedemorton added a commit to dedemorton/beats that referenced this pull request Oct 18, 2018
…lastic#8290)

* Improve Elasticsearch output docs about indices, pipelines, and keys settings

* Updates from review

* Change setting name from mapping to mappings

* Remove note to reviewer
dedemorton added a commit that referenced this pull request Oct 19, 2018
…8478) (#8528)

* Clarify support for ssl options for modules (#7967)

* Clarify support for ssl options for modules

* Change example to show http module

* Update Elasticsearch module examples to show http in the URL (#8226)

* Improve reference docs that describe how to set options dynamically (#8290)

* Improve Elasticsearch output docs about indices, pipelines, and keys settings

* Updates from review

* Change setting name from mapping to mappings

* Remove note to reviewer

* Fix conditional coding (#8446)

* Suppress dashboard info when dashboards aren't available (#8395)

* Clarify add_docker_metadata docs (#8478)
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…tic#8290 elastic#8395 elastic#8446 elastic#8478) (elastic#8528)

* Clarify support for ssl options for modules (elastic#7967)

* Clarify support for ssl options for modules

* Change example to show http module

* Update Elasticsearch module examples to show http in the URL (elastic#8226)

* Improve reference docs that describe how to set options dynamically (elastic#8290)

* Improve Elasticsearch output docs about indices, pipelines, and keys settings

* Updates from review

* Change setting name from mapping to mappings

* Remove note to reviewer

* Fix conditional coding (elastic#8446)

* Suppress dashboard info when dashboards aren't available (elastic#8395)

* Clarify add_docker_metadata docs (elastic#8478)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants