-
Notifications
You must be signed in to change notification settings - Fork 149
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
[Standalone] Simplify the required config for inputs #2416
[Standalone] Simplify the required config for inputs #2416
Comments
@belimawr For this issue worth setting up a kick off call with the o11y folks in order to agree on the scope and outcomes. |
After talking with the Observability folks, @cmacknz and @joshdover we got to the following minimal config and considerations: inputs:
- type: filestream
id: unique-id-per-input
paths:
- /var/log/my-file/my.log*
|
I did some testing and the following configuration already works: outputs:
default:
type: elasticsearch
hosts:
- http://localhost:9200
username: "elastic"
password: "changeme"
inputs:
- id: elastic-agent-input-id
type: filestream
streams:
- id: filestream-input-id
paths:
- /tmp/log.log |
One key bit that I think is missing is the support for the inputs:
- type: filestream
id: unique-id-per-input
data_stream.dataset: mystuff
paths:
- /var/log/my-file/my.log* Another thing that should be tested that I stumbled over in the past with this, that this only worked as an object and not flattened. What I mean by that is that the above would not work but the one below does. Both should just work. inputs:
- type: filestream
id: unique-id-per-input
data_stream:
dataset: mystuff
paths:
- /var/log/my-file/my.log* Some questions on the above points:
|
I think creating a variant of the log/filestream inputs that do not use a streams section is an important simplification, because it eliminates the need to specify both unique input IDs and unique stream IDs. Both users and developers struggle to understand the difference and the consequences of not choosing IDs correctly, if we can just remove the need to do this twice it will eliminate bugs and support cases. We have a support case right now where someone hasn't done this correctly when installing multiple instances of the k8s integration. |
If the I know that for logs there is a range of valid types, I'm not sure about the other inputs. One "problem" with having this generic is that One solution I see is to limit the simplified log ingestion to |
I've just tested it and indeed the flattened version ( |
My draft code: https://github.com/belimawr/beats/tree/simple-log-ingest-config (mostly for me to remember :P) |
My understanding is the current approach you are taking is that parts on the transformation layer change. An alternative could be that it is just forwarded to Filebeat and Filebeat needs to support exactly this format. I always hoped eventually to get rid of any transformations and the binaries support all the configs directly. |
I missed this change, great to hear. Does this mean I could take the current Elastic Agent input config with the streams and filebeat supports it directly? Meaning we start to converge on Agent configs work also in Beats. |
We still transform the agent policy into a Beat configuration, the logic to do this just lives in Filebeat instead and doesn't use the transpiler at all. https://github.com/elastic/beats/blob/103869cb3d5f312fb4aed3910ea059a7d5147055/x-pack/libbeat/management/generate.go#L71 This code is only hit when the configuration come in via the agent control protocol, so you can't just use it directly with Filebeat today. |
Having the transformation in Beats is what I hoped for. Having it there means in "theory" it could makes its way also in actual config itself (not a feature request). Thx for the details. |
Reopening this to make sure we document this in the agent docs at https://github.com/elastic/ingest-docs/tree/main/docs/en/ingest-management |
I suggest to make #3191 a dependency of this also before closing. Not having it can be pretty confusing for users. |
Here is the PR for the last missing piece, the docs: elastic/ingest-docs#473. I added it next to the standalone configuration section. Any suggestions on how to better document it are greatly appreciated. |
Using Elastic Agent with basic inputs has some rough edges that could be smoothed out in order to make simple “tail a file” and related use cases easier to get right. There’s just too many papercuts that make these simple use cases hard to use standalone Agent for.
A very basic “tail a file” configuration for standalone agent looks like this today:
We could simplify this by:
streams
block optional, only require if multiple streams on the same input are useddata_stream.dataset
does not workuse_output
optional (maybe already the case?)data_stream.* fields
and instead will use reasonable defaults based on the input type (eg. logs-generic-default or metrics-generic-default). We should update our example configuration and agent policy generated by Fleet to take advantage of this change.An ideal minimal configuration for tailing a log should look like this:
data_stream.*
field are filled with defaults for the input typeuse_output
defaults todefault
or, if there is only 1 output, whatever output that is. Otherwise throws an error to force the user to specify an output.name
is not requiredid
is not required (unless you have multiple inputs)stream
block is not requiredOpen questions
inputs
array?logfile
andfilestream
inputs?The text was updated successfully, but these errors were encountered: