I am putting together bits and pieces from examples to create my first custom filebeats input.
I have 10s of thousands of these files, that I would like to read into ES.
cdv_nrings=8
cdv_phone=16188835888
cdv_informat=NONE
cdv_tries=1
cdv_callTime=0
cdv_newApp=arcVXML2
cdv_retryInterval=0
cdv_initialScript=http://10.30.30.17:8080/pre/vui/aOut/1176825
cdv_applicationData=15740
# 2015/09/18 17:03:16
##Fri Sep 18 17:03:59 2015
#OutboundRetCode:603 VXML Event: error.com.arc.tel_initiatecall.tel_failure
I was thinking that I want to define some group names to match my unique field names:
My regex doesn't work in the online testers, I cant see to describe the new line properly, maybe that's not my problem?
multiline.pattern: '=(?P<cdv_nrings>re\w+$)\n=(?P<cdv_phone>re\w+$)\n=(?P<cdv_informat>re\w+$)\n=(?P<cdv_tries>re\w+$)\n=(?P<cdv_callTime>re\w+$)\n=(?P<cdv_newApp>re\w+$)\n=(?P<cdv_retryInterval>re\w+$)\n=(?P<cdv_initialScript>re\w+$)\n=(?P<cdv_applicationData>re\w+$)\n#(?P<date>re\w+$)\n##(?P<daydate>re\w+$)\n#(?P<OutboundRetCode>re\w+$)'
Then in my filebeat.yml file I would match the group name to the field name:
- type: log
enabled: true
close_eof: true
paths:
- C:\OCS\work\0.CDF*
fields:
log_type: work_active
cdv_nrings: cdv_nrings
cdv_phone: cdv_phone
cdv_informat: cdv_informat
cdv_tries: cdv_tries
cdv_callTime: cdv_callTime
cdv_newApp: cdv_newApp
cdv_retryInterval: cdv_retryInterval
cdv_initialScript: cdv_initialScript
cdv_applicationData: cdv_applicationData
date: date
daydate: daydate
OutboundRetCode: OutboundRetCode
multiline.pattern: '=(?P<cdv_nrings>re\w+$)\n=(?P<cdv_phone>re\w+$)\n=(?P<cdv_informat>re\w+$)\n=(?P<cdv_tries>re\w+$)\n=(?P<cdv_callTime>re\w+$)\n=(?P<cdv_newApp>re\w+$)\n=(?P<cdv_retryInterval>re\w+$)\n=(?P<cdv_initialScript>re\w+$)\n=(?P<cdv_applicationData>re\w+$)\n#(?P<date>re\w+$)\n##(?P<daydate>re\w+$)\n#(?P<OutboundRetCode>re\w+$)'
multiline.negate: false
multiline.match: before
I tested my config and that passed:
C:\filebeat-6.4.3-windows-x86_64>filebeat test config filebeat.yml
Config OK
Then I would set something up for Kibana Template but I have not got to this part at this time.
I am on the correct track here?
How does my regex look?
Thanks
Update:
I tried this regex and I got closer but not perfect
^(.+)=(.+)(\r\n\s+(.+))|^#\s(.+)(\r\n\s+(.+))|^##(.+)(\r\n\s+(.+))*|^#(.+):(.+)(\r\n\s
+(.+))