Getting Data In

How to edit props.conf to line merge a set of results?

Sayanta_Basak_I
Explorer

Hello

I have below set of line events(repeating) which I want to convert to single event. For every 6 events I want to convert it to 1 event, viz below

07/24/2017 16:16:31 host=myhost SMB1Enabled=0x0
07/24/2017 16:16:31 host=host=myhost PSExecEnabled=0x0
07/24/2017 16:16:31 host=host=myhost SymantecDefsDate=2017-07-24
07/24/2017 16:16:31 host=host=myhost SystemInfected=0x0
07/24/2017 16:16:31 host=host=myhost SymantecRunningStatus=0x1
07/24/2017 16:16:31 host=host=myhost SymantecProductionVersion=12.1.5337.5000

To go ahead with a multi line merge should I go ahead with below config change in props.conf

[my_sourcetype]
SHOULD_LINEMERGE = true
BREAK_ONLY_BEFORE=([\r\n]+)(?=\d{1,2}\/\d{1,2}\/\d{4}\s\d{1,2}:\d{1,2}:\d{1,2}\shost=/^\w{1,20}$/\sSMB1Enabled)
MAX_EVENTS=6

But it does not seem to work, Help would be appreciated
@lguinn @bwooden @kristian.kolb @woodcock

Regards
Sayanta B

0 Karma

bwooden
Splunk Employee
Splunk Employee

It would be easier at search time. From the small data sample we can see it would likely make the most sense to have each line with its own timestamp indexed as a separate event and then stitch transactions together in ad hoc searches or reports using the stats command or transaction command.

0 Karma

woodcock
Esteemed Legend

Do the lines to merge really have host=host=? If so, that will make it very easy.

0 Karma

s2_splunk
Splunk Employee
Splunk Employee

Try using BREAK_ONLY_BEFORE=^\d{1,2}\/\d{1,2}\/\d{4}\s\d{1,2}:\d{1,2}:\d{1,2}\shost=.*\sSMB1Enabled.
No need to use capture groups or the line feed, if you anchor to the beginning of the line.

0 Karma

Sayanta_Basak_I
Explorer

Thank you @ssievert

Adding the below in props.conf seems to do its work to some extent

[my_sourcetype]
BREAK_ONLY_BEFORE = SMB1Enabled

Now the events are coming in below format. So its considering the default line break post the SMB1* line and then again waiting for the next matching regex. How to do it differently to merge all 6 events as part of 1

alt text

@Anonymous @bwooden @kristian.kolb @woodcock

0 Karma

bwooden
Splunk Employee
Splunk Employee

I was able to get it working using this props config, though admittedly I don't have the full data set.

SHOULD_LINEMERGE=FALSE
LINE_BREAKER=([\r\n]+)\d{2}\/\d{2}\/\d{4}\s\d{1,2}:\d{1,2}:\d{1,2}\shost=.*\sSMB\dEnabled
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...