Hello
I am wondering, if it is possible to use multiline parsing in TCP input. In my tests it is not working. But in UDP input, multiline parsing is working (but not recommended).
Filebeat version: 6.5.3
OS: CentOS 7.6
Configuration file filebeat.yml:
filebeat.inputs:
- type: tcp
host: "localhost:9003"
multiline:
pattern: '^\s+'
negate: false
match: after
- type: udp
host: "localhost:9003"
multiline:
pattern: '^\s+'
negate: false
match: after
output.console:
pretty: true
Test commands:
TCP:
$ echo -e "hello\n world" | nc 127.0.0.1 9003
UDP:
$ echo -e "hello\n world" | nc -u 127.0.0.1 9003
Filebeat console output:
{
"@timestamp": "2018-12-18T08:07:40.763Z",
"@metadata": {
"beat": "filebeat",
"type": "doc",
"version": "6.5.3"
},
"message": "hello",
"source": "127.0.0.1:54206",
"input": {
"type": "tcp"
},
"prospector": {
"type": "tcp"
},
"beat": {
"name": "atlantis.vagrant.local",
"hostname": "atlantis.vagrant.local",
"version": "6.5.3"
},
"host": {
"name": "atlantis.vagrant.local"
}
}
{
"@timestamp": "2018-12-18T08:07:40.764Z",
"@metadata": {
"beat": "filebeat",
"type": "doc",
"version": "6.5.3"
},
"message": " world",
"source": "127.0.0.1:54206",
"input": {
"type": "tcp"
},
"prospector": {
"type": "tcp"
},
"beat": {
"name": "atlantis.vagrant.local",
"hostname": "atlantis.vagrant.local",
"version": "6.5.3"
},
"host": {
"name": "atlantis.vagrant.local"
}
}
{
"@timestamp": "2018-12-18T08:07:45.824Z",
"@metadata": {
"beat": "filebeat",
"type": "doc",
"version": "6.5.3",
"truncated": false
},
"beat": {
"name": "atlantis.vagrant.local",
"hostname": "atlantis.vagrant.local",
"version": "6.5.3"
},
"host": {
"name": "atlantis.vagrant.local"
},
"message": "hello\n world\n",
"source": "127.0.0.1:41991",
"prospector": {
"type": "udp"
},
"input": {
"type": "udp"
}
}
Thanks for clarification.
Kind regards
Elmar