Getting Data In

props

abhi04
Communicator

Hi I am trying to divide the the logs into different evwnt based on below scenario:

I have one single event currently:

Issuer : hjlhjk

a: xyz 

PrivateKey : abc

Issuer : dfjh

a: fhfh

PrivateKey : dsgd

 

Now I want it as two events:

 

event1:

Issuer : hjlhjk

a: xyz 

PrivateKey : abc

 

event2:

Issuer : dfjh

a: fhfh

PrivateKey : dsgd

 

how can i get this?

 

 

I tried below line breaking which is not working

[sourcetype]
LINE_BREAKER = ([\r\n]+)(PrivateKey)

 

[sourcetype]
BREAK_ONLY_BEFORE = Issuer
SHOULD_LINEMERGE = false

 

Labels (1)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @abhi04 ,

Can you please try below?

[sourcetype]
LINE_BREAKER = PrivateKey\s+:\s+\w+([\r\n]+)
SHOULD_LINEMERGE = false

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @abhi04 ,

Can you please try below?

[sourcetype]
LINE_BREAKER = PrivateKey\s+:\s+\w+([\r\n]+)
SHOULD_LINEMERGE = false

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

abhi04
Communicator

Hi @scelikok I missed mentioning that Private key can be one of the below format:

format 1:

PrivateKey : abc.def.ghi.jkl

 

format 2:

PrivateKey : 

 

Meaning it can be empty as well as in format 1

0 Karma

abhi04
Communicator

These logs are collected using scripted input using .bat file it has several lines in one events , I only showed 6 lines per event but the repetion is same with more lines in between privatekey and issuer

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!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...