Skip to content

Clarify docs about manually loading the template#5635

Merged
andrewkroh merged 3 commits intoelastic:masterfrom
dedemorton:beats_issue#5615
Nov 23, 2017
Merged

Clarify docs about manually loading the template#5635
andrewkroh merged 3 commits intoelastic:masterfrom
dedemorton:beats_issue#5615

Conversation

@dedemorton
Copy link
Copy Markdown
Contributor

@dedemorton dedemorton commented Nov 18, 2017

Resolves #5615

I also did a bit of editing to pare away some unnecessary words, reflow sections, and add context where I felt it was missing.

The conditional coding on this particular topic is a bit eccentric due to the existence of Winlogbeat, so I'm going to paste a screen capture of the compiled webpage here. For Winlogbeat (not shown here), all the unix-specific commands are removed.

These screens are old. See the diff for changes

load-template

(I'm going to fix the "pass credentials" section in a separate PR because it's shared content that lives in a separate file.)

["source","sh",subs="attributes"]
----
./{beatname_lc} setup --template
./{beatname_lc} setup --template -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["localhost:9200"]'
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.

decided to show this in the example since it sounds like the most common use case for manual loading is when Logstash output is configured.


["source","sh",subs="attributes"]
----
./{beatname_lc} export template > {beatname_lc}.template.json
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For Winlogbeat I think it makes sense to show the curl command because you might export it on Windows and then import it on a *nix machine. This does mess up the conditional logic because the export command needs to be .\{beatname_lc}.exe.

To solve this I recommend breaking apart the export and import steps. Keep the conditional logic around the export commands. And always show how to import it using both Windows (Invoke-RestMethod ) and nix (curl).

@andrewkroh
Copy link
Copy Markdown
Member

In the section where we show how to delete the index I think we should show the equivalent Windows command.

Invoke-RestMethod -Method Delete "http://localhost:9200/filebeat-*"

docker run {dockerimage} setup --template -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["localhost:9200"]'
----------------------------------------------------------------------


Copy link
Copy Markdown
Contributor Author

@dedemorton dedemorton Nov 21, 2017

Choose a reason for hiding this comment

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

Adding double line breaks after examples because it fixes rendering issues when these files are viewed on GitHub (I can't do this for examples that exist within lists, so you'll notice some inconsistencies here).

@dedemorton
Copy link
Copy Markdown
Contributor Author

@andrewkroh I've made the changes that you requested. I decided to make the Note a separate section because it was getting too long to be a note.

I have not updated the original screen shots in the PR to show these changes. If you want me to, just let me know.

==== Load the template manually (alternate method)

If the host running {beatname_uc} does not have direct connectivity to
Elasticsearch, you can export the index template to a file and then install the
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe it won't be obvious to users that they need to move or copy it to a different machine with ES connectivity. Should we add this into this sentence (e.g. export, transfer, and then install)?

+
["source","sh",subs="attributes"]
----
curl -XPUT -H 'Content-Type: application/json' http://elasticsearch:9200/_template/{beatname_lc}-{stack-version} -d@{beatname_lc}.template.json
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In other places we just use localhost:9200. To be consistent I think this (and the one below) should also be localhost:9200.

@dedemorton
Copy link
Copy Markdown
Contributor Author

@andrewkroh I've made the additional changes that you requested.

Copy link
Copy Markdown
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

LGTM

@andrewkroh andrewkroh merged commit db968aa into elastic:master Nov 23, 2017
@dedemorton dedemorton added the needs_backport PR is waiting to be backported to other branches. label Nov 23, 2017
@dedemorton dedemorton deleted the beats_issue#5615 branch November 28, 2017 19:31
dedemorton added a commit to dedemorton/beats that referenced this pull request Nov 28, 2017
Clarify docs about manually loading the template
dedemorton added a commit to dedemorton/beats that referenced this pull request Nov 28, 2017
Clarify docs about manually loading the template
@dedemorton dedemorton removed the needs_backport PR is waiting to be backported to other branches. label Nov 28, 2017
ruflin pushed a commit that referenced this pull request Nov 28, 2017
Clarify docs about manually loading the template
ruflin pushed a commit that referenced this pull request Nov 28, 2017
Clarify docs about manually loading the template
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
Clarify docs about manually loading the template
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
Clarify docs about manually loading the template
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.

Docs to manually loading template in 6.0

2 participants