Splunk Search

How to line break raw events

Sailesh6891
Engager

Hi, 

I have a log file on the server which I ingested in splunk through input app where I defined the index , sourcetype and monitor statement in inputs.conf. Log file on the server looks like below:

xyz
asdfoasdf
asfanfafd
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sdfsdfja
agf[oija[gfojerg
fgoaierr
apodsifa[soigaiga[oiga[dogj
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sadfnasd;fiasfdoiasndf'i
dfdf
fd
garehaehseht
shse
thse
tjst
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
asdf;nafdsknasdf
asdfknasdfln
asdf;nasdkfnasf
asogja'fja
foj'apogj
aogj
agf

 

When I try searching the log file in splunk, Logs are visible howerver events are not breaking as I expect it to come. I want events to be separated as below

 

Event 1:

xyz
asdfoasdf
asfanfafd
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Event 2:

sdfsdfja
agf[oija[gfojerg
fgoaierr
apodsifa[soigaiga[oiga[dogj

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

 

Event 3:


sadfnasd;fiasfdoiasndf'i
dfdf
fd
garehaehseht
shse
thse
tjst

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Event 4:

asdf;nafdsknasdf
asdfknasdfln
asdf;nasdkfnasf
asogja'fja
foj'apogj
aogj
agf

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Sailesh6891 ,

did you tried to use LINE_BREKING option in props.conf?

[your-sourcetype]
LINE_BREAKING = :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Ciao.

Giuseppe

0 Karma

Sailesh6891
Engager

No, I have not used LINE_BREAKING option. 

Do I need to create a props.conf under splunk_home$/etc/apps/local/ 

and mention these 2 lines ?i.e [sourcetype] and LINE_BREAKING =  :::::::::::::::::::

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Sailesh6891 ,

it's a best practive to create a custom add-on containing all the parsing rules for your data, also because I suppose that there are other parsing rules that you need to add.

but anyway you can also put this two lines in another props.conf.

Ciao.

Giuseppe

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 ...