Filebeat 6.2
I am using filebeat to pick up two files and send them to two different logstash endpoints.
My config looks like:
---
filebeat.prospectors:
- type: log
enabled: true
paths:
- path/to/log1.log
multiline.pattern: '^[[:space:]]+\{'
multiline.negate: true
multiline.match: after
processors:
- decode_json_fields:
fields: ["message"]
tags: ["airdrop"]
- type: log
enabled: true
paths:
- /path/to/log2.log
processors:
- drop_fields:
fields: ["beat.name", "beat.hostname", "beat.version", "beat", "host", "input_type", "source", "prospector.type"]
output.logstash:
when:
contains:
tags: tag1
hosts: ["domain1.com:443"]
ssl.certificate_authorities: ["/pat/to/cert/cloud-chain-sha512.crt"]
loadbalance: true
when:
contains:
tags: airdrop
hosts: ["domain2.com:443"]
ssl.certificate_authorities: ["path/to/cert/cloud-chain-sha512.crt"]
loadbalance: true
Contents of my file look like:
{
"timestamp" : "2018-04-19 07:34:54.895609-0400",
"source" : null,
"messageType" : "Default",
"processID" : 633,
"category" : "AirDrop",
"traceID" : 9203118583709700,
"machTimestamp" : 32749127946,
"eventMessage" : "Loading all persisted transfers",
"activityIdentifier" : 0,
"subsystem" : "com.apple.sharing",
"signpostID" : 0,
"processImageUUID" : "34BD8CEF-7770-3DF6-9B02-B32788EA0C35",
"threadID" : 3889,
"senderImageUUID" : "34BD8CEF-7770-3DF6-9B02-B32788EA0C35",
"parentActivityIdentifier" : 0,
"eventType" : "logEvent",
"processImagePath" : "/usr/libexec/sharingd",
"senderProgramCounter" : 823548,
"senderImagePath" : "/usr/libexec/sharingd",
"timezoneName" : ""
},
{
"processImageUUID" : "34BD8CEF-7770-3DF6-9B02-B32788EA0C35",
"threadID" : 3889,
"senderImageUUID" : "34BD8CEF-7770-3DF6-9B02-B32788EA0C35",
"parentActivityIdentifier" : 0,
"processImagePath" : "/usr/libexec/sharingd",
"eventType" : "logEvent",
"timezoneName" : "",
"senderImagePath" : "/usr/libexec/sharingd",
"senderProgramCounter" : 1086398,
"source" : null,
"timestamp" : "2018-04-19 08:04:51.359642-0400",
"processID" : 633,
"category" : "AirDrop",
"messageType" : "Default",
"machTimestamp" : 1828470400459,
"traceID" : 9261530138935300,
"eventMessage" : "startSending, validated airdrop items. properties: {\n ConvertMediaFormats = 0;\n Files = (\n {\n ConvertMediaFormats = 0;\n FileBomPath = \"./WP-Disaster-Recovery-Apache-Kafka.pdf\";\n FileIsDirectory = 0;\n FileName = \"WP-Disaster-Recovery-Apache-Kafka.pdf\";\n FileType = \"com.adobe.pdf\";\n }\n );\n ReceiverComputerName = dca9049727a4;\n ReceiverID = b22b03e0f785;\n VerifiableIdentity = 0;\n}",
"activityIdentifier" : 0,
"signpostID" : 0,
"subsystem" : "com.apple.sharing"
}
]
My issue is that my multiline confi isn't working. Can someone tell my what it is I am doing wrong with it? I thought I was saying look for something starting with space
+{
and create the single line out of that. But I am not getting that at the moment. When I run the config as is I get json parse errors and strange looking fileds.
Any help would be great.