I attempted to import data from a json file into Elasticsearch, but my filebeat had a configuration issue in filebeat.yml or an issue with the input Because my json is regular json, but filebeat only supports ndjson,
Filebeat.yml
filebeat.inputs:
- type: log
enabled: true
paths:
- Metrics.json
multiline.pattern: '^{'
multiline.negate: true
multiline.match: after
processors:
- decode_json_fields:
fields: ["message"]
process_array: false
max_depth: 2
target: Json
overwrite_keys: true
add_error_key: false
output.elasticsearch:
hosts: ["localhost:9200"]
Json Input
{
"Sourcedata": [
{
"Language": " C",
"Code": 106026
},
{
"Language": " C++",
"Code": 52166
}
]
}
- How to convert JSon to ndjson?
- What problem with my filebeat configuration?