This filebeat.yml config will receive input from stdout, do some processing and write output to stdout.
echo "message" | filebeat -c `pwd`/filebeat.yml -e 2> /dev/null
{
"@timestamp": "2021-03-16T06:33:41.449Z",
"@metadata": {
"beat": "filebeat",
"type": "_doc",
"version": "7.9.0"
},
"input": {
"type": "stdin"
},
"host": {
"name": "xxx"
},
"agent": {
"type": "filebeat",
"version": "7.9.0",
},
"ecs": {
"version": "1.5.0"
},
"example": {
"key1": "val1",
"key2": "val2"
},
"log": {
"offset": 0,
"file": {
"path": ""
}
},
"message": "message"
}