Splunk Search

How to add line break in the eval function?

kiran331
Builder

Hi

How to add the line break in the eval function

base search|eval new =  src_host+","+"Event Code="+EventCode+","+"Sub-Code="+code+","+"Reason="+Reason+","|makemv new delim=","

Output:

Server1
Event Code=4625
Sub-Code=0xC0000234
Reason=Account locked out.
server2
Event Code=4771
Sub-Code=0x12
Reason=NULL

What I need:

Server1
Event Code=4625
Sub-Code=0xC0000234
Reason=Account locked out.

server2
Event Code=4771
Sub-Code=0x12
Reason=NULL
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Have you tried

base search|eval new = src_host+","+"Event Code="+EventCode+","+"Sub-Code="+code+","+"Reason="+Reason+",\n,"|makemv new delim=","
---
If this reply helps you, Karma would be appreciated.

kiran331
Builder

I tried this, this is the result I got instead of empty line.

Server1
Event Code=4625
Sub-Code=0xC0000234
Reason=Account locked out.
\n
server2
Event Code=4771
Sub-Code=0x12
Reason=NULL
\n
server3
Event Code=4771
Sub-Code=0x18
Reason=NULL
\n

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Based on those results, I suggest this. Note the two commas following the Reason field.

base search|eval new = src_host+","+"Event Code="+EventCode+","+"Sub-Code="+code+","+"Reason="+Reason+",,"|makemv new delim=","
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...