-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Conversation
[[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. |
There was a problem hiding this comment.
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)
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. |
There was a problem hiding this comment.
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."
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? |
93accd2
to
1a73e01
Compare
== 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change "then" to "than"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@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`: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, will do
5a302b9
to
aabd60a
Compare
|
||
["source","yaml",subs="attributes"] | ||
------------------------------------------------------------------------------ | ||
person: \{name: "John Doe", age: 34, country: "Canada"} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
.
@urso This is excellent! I really hope people take the time to read it. 👍 |
aabd60a
to
3e3e210
Compare
@urso Intro is much easier to follow now. Looks good! I'll plan to edit the content sometime before the beta release. |
@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). 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. |
@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? |
Document config file format + structure.
config files with duplicate (out of date) docs:
shared-env-vars.asciidoc
yaml.asciidoc (also shared)