-
Notifications
You must be signed in to change notification settings - Fork 148
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
[Elastic Agent] Add support for parsers configuration for Hints Autodiscover #3102
Comments
@cmacknz , @rdner (because you worked in filestream input in the past) I cc you here in order to help us investigate how we can update the parsers configuration from a given user's input. In beats we had the But now in agent and filestream input we would like to offer the same flexibility to our users and through For processors (see eg. https://github.com/elastic/elastic-agent/pull/3107/files#diff-ed933ad9cf09eb9ca797c5c89b5e8991624cbe5301d88f996d9bd947f4e3ea16R455) we have the relative map exposed and we can configure/ update the new list. I am struggling to find a way to see how I can edit parsers config. Any help here really appreciated |
This is more of an agent composable provider question than a filestream question. The |
@cmacknz thanks for looking into this. I was having a look into this today and I see that: Wondering if there is another way to do so? But still can not find something |
@cmacknz one step at a time, I fixed some errors and now at least the functionality now is not broken, autodiscovery works, but the parsers not added :)
annotations:
co.elastic.hints/parsers.ndjson.add_error_key: 'false'
co.elastic.hints/parsers.ndjson.message_key: "pas"
Summary is that the processors are being added from autodiscovery but not parsers. - data_stream.namespace: default
id: hints-filestream-container-logs-62d546c0055ce651842f8ec7b3911439555a66aaf6b238f87e765917a90cef66-kubernetes-e36973fb-debd-4252-a402-f7b185ce286e.nginx
name: hints-filestream-container-logs
original_id: hints-filestream-container-logs-62d546c0055ce651842f8ec7b3911439555a66aaf6b238f87e765917a90cef66
processors:
- add_fields:
fields:
id: 62d546c0055ce651842f8ec7b3911439555a66aaf6b238f87e765917a90cef66
image:
name: nginx
runtime: containerd
target: container
- add_fields:
fields:
container:
name: nginx
....
- add_fields:
fields:
cluster:
name: kind
url: kind-control-plane:6443
target: orchestrator
- add_fields:
fields:
name: myproject
target: project
- rename:
fail_on_error: "false"
fields:
"0":
from: message
"1":
to: pasole
streams:
- data_stream:
dataset: kubernetes.container_logs
type: logs
parsers:
- container:
format: auto
stream: all
paths:
- /var/log/containers/*62d546c0055ce651842f8ec7b3911439555a66aaf6b238f87e765917a90cef66.log
prospector:
scanner:
symlinks: true
type: filestream
use_output: default
outputs:
default:
allow_older_versions: true
hosts:
- https://elasticsearch:9200
password: changeme
ssl:
verification_mode: none
type: elasticsearch
username: elastic
providers:
kubernetes:
hints:
default_container_logs: false
enabled: true
node: kind-control-plane
scope: node cc @ChrsMark for reference |
I haven't spent much time in this part of the agent code unfortunately, so I don't see anything obvious. |
Hey folks, coming late to this discussion. A couple of thoughts:
ref: filestream inputs
For processors (in hints) it was different since the processors were already part of the In this, I would suggest taking a step back and discuss what we want to achieve here. If I'm not mistaken we just want to support parsers' configurations through hints. I also see how the parsers' case is similar to the processor's one since it hits the same issue: #735 So how about just supporting parsers only in hints templates that are based on the filestream input? This means that parsers would be defined as placeholders within the templates like all other hints and would be populated in the hintsMapping. Happy to brainstorm more on this if needed. |
Hey, I wanted to give it a try to see if it can work tbh. Until now I have not seen any other example of parsers (@cmacknz can correct me on this) I have tested the decode_json_fields processor with the filestream and hints autodicovery. I have added a doc section here elastic/ingest-docs@2c72477 So I guess for now we can park the parsers support with hints until #735 is prioritised. @cmacknz do you have any plans for this? I think @ChrsMark the #3161 is getting bigger priority now in order to allign autodiscovery with beats.
I will try to have a look next weeks as well but any ideas are more than welcome |
#735 isn't on our roadmap at all right now. Filestream is also the only input that uses parsers today AFAIK. |
This issue will be closed for now as json decoding can be performed with |
Describe the enhancement:
We need hint support for json and multiline parsers from annotations that defined from the users
Describe a specific use case for the enhancement or feature:
Agent configuration:
See above that type: filestream
The user will define in the pod:
And those will produce the following block:
What is the definition of done?
The text was updated successfully, but these errors were encountered: