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

Document config file format #2132

Merged
merged 1 commit into from
Aug 16, 2016
Merged

Conversation

urso
Copy link

@urso urso commented Jul 29, 2016

Document config file format + structure.

config files with duplicate (out of date) docs:
shared-env-vars.asciidoc
yaml.asciidoc (also shared)

@urso urso added docs in progress Pull request is currently in progress. discuss Issue needs further discussion. labels Jul 29, 2016
[[config-file-format]]
== Config file format

Beats config files are based on http://www.yaml.org[YAML], a file format that is easier to read and write then other common data format like XML or JSON.
Copy link
Contributor

Choose a reason for hiding this comment

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

should be "than other common data formats" (plural)

@dedemorton
Copy link
Contributor

Great idea!

[float]
==== Use Spaces for Indentation

Indentation is meaningful in YAML. Make sure that you use spaces, rather than tab characters, to indent sections.
Copy link
Contributor

Choose a reason for hiding this comment

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

We could add something like: "In the default configuration files and in all the examples in the documentation, we use 2 spaces per indentation level. We recommend you do the same."

@urso
Copy link
Author

urso commented Jul 31, 2016

How should we add this doc best to our documentation?

On the one hand I like it to be generic (as config file format is same for community-beats) and have beats docs point to this docs, on the other hand it duplicates content in yaml.asciidoc which is just some tips specific per beat (rather would like to include 'Config file format' doc with every beat).

Question: with config file structure having nested namespaces, how can we make namespacing usage more clear beats config reference?

== Config file format

Beats config files are based on http://www.yaml.org[YAML], a file format that is
easier to read and write then other common data formats like XML or JSON.
Copy link
Contributor

Choose a reason for hiding this comment

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

change "then" to "than"

Copy link
Author

Choose a reason for hiding this comment

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

done

@dedemorton
Copy link
Contributor

@urso I'm done with high level comments. I'd like to do a detailed technical edit of this content after you've merged it (me adding line notes is tedious for everyone). I can take care of the restructuring that I've suggested.

<<config-file-format-env-vars>> do. Only fully collapsed setting names can be
referenced to.

Example referencing `es.host` in `output.elasticsearch.hosts`:
Copy link
Contributor

Choose a reason for hiding this comment

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

@urso One more thing to add: Before introducing the concept of custom named settings, I would first introduce a simple example like:
filebeat.registry_file: ${path.data}/registry

Maybe even call out specifically that you can reference the path settings.

Copy link
Author

Choose a reason for hiding this comment

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

good point, will do

@urso urso force-pushed the doc/config-file-format branch from 5a302b9 to aabd60a Compare August 12, 2016 15:13
@urso
Copy link
Author

urso commented Aug 12, 2016

updated PR + fixed build + squashed all commits.

Currently looks like this:

screen shot 2016-08-12 at 17 15 12

@urso urso removed the in progress Pull request is currently in progress. label Aug 12, 2016

["source","yaml",subs="attributes"]
------------------------------------------------------------------------------
person: \{name: "John Doe", age: 34, country: "Canada"}
Copy link
Member

Choose a reason for hiding this comment

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

Is that leading escape on the { required?

Copy link
Author

Choose a reason for hiding this comment

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

yes, otherwise doc build breaks for me. {<name>: ...} is obviously something special in asciidoc.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I thought it might be for asciidoc.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's doing that because you have subs="attributes" defined for the code block. You only need to include subs="attributes" if the code block includes a variable reference that you want asciidoc to resolve. So if you had {beatname_lc} in the example block and wanted it to resolve to Packetbeat or something, you would include subs="attributes".

@andrewkroh
Copy link
Member

@urso This is excellent! I really hope people take the time to read it. 👍

@urso urso force-pushed the doc/config-file-format branch from aabd60a to 3e3e210 Compare August 12, 2016 17:12
@dedemorton
Copy link
Contributor

@urso Intro is much easier to follow now. Looks good! I'll plan to edit the content sometime before the beta release.

@dedemorton
Copy link
Contributor

@urso BTW, I think the current location of the content in the platform ref isn't right (users who are reading the platform ref won't even know about the config file until after they've installed their beat).
If we want to include this doc in the platform ref (so it's available to developers), it belongs under the Developer Guide section.

I can work on getting the content into the appropriate sections after it's merged, if you'd like. Just wanted to flag this issue because the current location isn't right.

@urso
Copy link
Author

urso commented Aug 13, 2016

@dedemorton yeah, that's another thing I struggled with. I put it after 'Getting Started...' so users have hopefully seen beats before, but felt like putting it into developers guide would hide the content. Maybe it makes sense to make this one available in Platform Ref. and per beat docs?

@dedemorton dedemorton merged commit 66636e7 into elastic:master Aug 16, 2016
@urso urso deleted the doc/config-file-format branch February 19, 2019 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issue needs further discussion. docs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants