Hi all, thanks for amazing product. I'm trying to set condition for docker logs ingestion and I'm not having success. I always get some kind of error, see below.
Please help me enable conditional logs based on label.
Using condition arrayContains(${docker.labels}, "filebeat_enable")
I get the following error:
$ elastic-agent inspect
Error: error printing config: error parsing config as hashmap: error unpacking subarray in config for skip key inputs: expected ',' when parsing 'arrayContains(${docker.labels}, "filebeat_enable")' accessing 'inputs.5'
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.17/fleet-troubleshooting.html
Trying condition arrayContains(${docker.container.labels}, "filebeat_enable") I get error
applying new policy: generating component model: rendering inputs failed: condition "arrayContains(${docker.container.labels}, "filebeat_enable")" evaluation failed: arrayContains: first argument must be an array; received map[string]interface {}
I tried arrayContains(${docker.labels}, 'filebeat_enable') with single quotes and when I execute elastic-agent inspect I see
Error: error printing config: error parsing config as hashmap: error unpacking subarray in config for skip key inputs: expected ',' when parsing 'arrayContains(${docker.labels}, 'filebeat_enable')' accessing 'inputs.5'
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.17/fleet-troubleshooting.html
Also tried arrayContains(${docker.container.labels}, 'filebeat_enable') and gives this error in logs:
[elastic_agent][error] applying new policy: generating component model: rendering inputs failed: condition "arrayContains(${docker.container.labels}, 'filebeat_enable')" evaluation failed: arrayContains: first argument must be an array; received map[string]interface {}
I would take the condition out... collect some logs and look at the labels etc... and see what fields are actually there then comeback and try the condition, that is what I would do.
wonder if you only have 1 label of you should just try a simple string compare.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.