Getting Data In

creating / adding a blank line in between the data in the file

abhayneilam
Contributor

I have a file which contains :

Hi this is really great of you !!
My name is john, how are you
this is no one

I am appending few more lines after the last line but before that i want a single blank line to distinguish both the content as : my output should look like this :


Hi this is really great of you !!
My name is john, how are you
this is no one

Hi, this is my new line started
I am happy to know you
great people always smile


Tags (4)
0 Karma

yannK
Splunk Employee
Splunk Employee

Are your lines parts of the same events ?

If the pattern is easy to recognize, I would recommend to use a sed command to add new lines characters.

  • at search time with | rex field=_raw mode=sed "s/mylastword/mylastword\n/g"
  • or at index time (more radical) with the sedcmd

in both case, please read the documentation for the commands.

If the pattern is not common, then you'd better fix your source format before indexing it.

0 Karma

MHibbin
Influencer

What does this have to do with Splunk? Surely you need to either specify you scenario if it is related!

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