Hi Stephen, i have a working config with only single output to a kafka topic and i wish to output to 2 different topics. I picked up some examples from Internet and it claimed this config worked.
Here's the error
Exiting: error loading config file: yaml: line 37: mapping values are not allowed in this context
Show me your entire exact working config filebeat.yml with 1 output that is working then show me your exact config trying multiple.. That first config you showed would have never worked it was invalid.
The config you shared has only 32 lines, so you didn't share the full config or you are running another config file for some reason.
Also, prospectors was changed to inputs in version 6.3 or 6.4, I'm not sure if the newer versions still works with the configuration using prospectors.
When checking examples from internet it is always good to look into the official documentation of the version you are using to see if the example still applies, the tools in Elastic Stack moves pretty fast and a lot of things can get deprecated or not work anymore.
As asked, share your working config and the config you are trying to run.
Hi, here's my working copy.
The objective is output to various kafka topic based on different inputs.
filebeat.inputs:
- type: log
# Change to true to enable this input configuration.
enabled: true
# Paths that should be crawled and fetched. Glob based paths.
paths:
- /xxx/xxx/xxx.txt
scan_frequency: 10s
backoff: 1s
close_inactive: 1m
ignore_older: 2h
clean_inactive: 25h
filebeat.config.modules:
# Glob pattern for configuration loading
path: ${path.config}/modules.d/*.yml
# Set to true to enable config reloading
reload.enabled: true
# Period on which files under path should be checked for changes
reload.period: 10s
# -------------------------------- Kafka Output --------------------------------
output.kafka:
enabled: true
hosts: ["192.xxx.xxx.120:9092", "192.xxx.xxx.122:9092", "192.xxx.xxx.123:9092"]
topic: "xxxxx1test"
There's nothing else to do, you just to make sure what config you are running, you share a config with 33 lines and you are saying that you got an error at line 37, this does not match.
Hi Leandro, Thank you for your help. I'm able to output 2 different logs to different topic.
Thank you
- type: log
# Change to true to enable this input configuration.
enabled: true
fields:
kafka_topic: "xxxxx1test"
# Paths that should be crawled and fetched. Glob based paths.
paths:
- /xxx/xxx/xxx/xxx/xxxx.txt
fields:
kafka_topic: "xxxxx1topic"
# Paths that should be crawled and fetched. Glob based paths.
paths:
- /var/log/messages
scan_frequency: 10s
backoff: 1s
close_inactive: 1m
ignore_older: 2h
clean_inactive: 25h
output.kafka:
enabled: true
hosts: ["kafka-brokers"]
topic: '%{[fields.kafka_topic]}'
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.