Splunk Enterprise

Help with props for this sample log?

mahesh27
Communicator

Hi All,

below are the sample logs:
can i get props for this sample logs.

 

-------------------------------------------------------------
Time: 02/12/2021 01:45:05.777
Message: there is a exception error code gg456hhhrgh34567
type: application code
data: system
-------------------------------------------------------------
-------------------------------------------------------------
Time: 24/12/2021 01:45:05.777
Message: there is a exception error code 897fghj56879hgj
type: application code jobs
data: system jobs
-------------------------------------------------------------

 

 

 

-------------------------------------------------------------
Time: 28/12/2021 02:54:15.767
Message: there is a exception error code 89hjyt5643edhjjy656
type: application code error 
data: system error
-------------------------------------------------------------
--------------------------------------
Timeline: 12/02/2021 12:44:32.667
Message Details - Application code contains error at 12/02/2021 11:30:00.212
--------------------------------------
--------------------------------------
Timeline: 23/02/2021 10:23:22.124
Message Details - Application code contains error at 12/02/2021 08:20:10.100
--------------------------------------
--------------------------------------
Timeline: 24/02/2021 10:20:12.667
Message Details - Application code contains error at 24/02/2021 07:10:23.112
--------------------------------------

 

 

Labels (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

If you want to keep the lines (I don't understand why, since they're of little value), then remove the SEDCMD and use this line breaker.

LINE_BREAKER = --+([\r\n]+)--+
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

What have you tried so far?  How did work for you?

---
If this reply helps you, Karma would be appreciated.

mahesh27
Communicator

i tried the blow props but ----- is coming down like this

[sourcetype]
LINE_BREAKER=[r\n]Timeline:\s\d{2}/\d{2}/\d{4}\s\d{2}:\d{2}:\d{2}.\d{3}|Time:\s\d{2}/\d{2}/\d{4}\s\d{2}:\d{2}:\d{2}.\d{3}
TIME_FORMAT=%d/%m/%Y %H:%M:%S.%3N
disabled=false
truncate=50000
MAX_TIMESTAMP_LOOKAHEAD=40
should_linemerge=false

Timeline: 23/02/2021 10:23:22.124
Message Details - Application code contains error at 12/02/2021 08:20:10.100
--------------------------------------
--------------------------------------
Time: 02/12/2021 01:45:05.777
Message: there is a exception error code gg456hhhrgh34567
type: application code
data: system
-------------------------------------------------------------
-------------------------------------------------------------


 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try these settings

 

[sourcetype]
LINE_BREAKER = ([\r\n]+)Time
TIME_FORMAT = %d/%m/%Y %H:%M:%S.%3N
disabled = false
TRUNCATE = 50000
MAX_TIMESTAMP_LOOKAHEAD = 40
SHOULD_LINEMERGE = false
SEDCMD-nodashes = s/--+//g

 

The original LINE_BREAKER setting was longer than it needed to be and didn't have a required capture group.  The SEDCMD setting removes the lines of dashes.

---
If this reply helps you, Karma would be appreciated.

mahesh27
Communicator

Hi @richgalloway ,

if we use SEDCMD  the --- lines are disappearing but i want that lines should display like shown below.
how can i do that??

-------------------------------------------------------------
Time: 02/12/2021 01:45:05.777
Message: there is a exception error code gg456hhhrgh34567
type: application code
data: system
-------------------------------------------------------------
-------------------------------------------------------------
Time: 24/12/2021 01:45:05.777
Message: there is a exception error code 897fghj56879hgj
type: application code jobs
data: system jobs
-------------------------------------------------------------

 

-------------------------------------------------------------
Time: 28/12/2021 02:54:15.767
Message: there is a exception error code 89hjyt5643edhjjy656
type: application code error 
data: system error
-------------------------------------------------------------
--------------------------------------
Timeline: 12/02/2021 12:44:32.667
Message Details - Application code contains error at 12/02/2021 11:30:00.212
--------------------------------------
--------------------------------------
Timeline: 23/02/2021 10:23:22.124
Message Details - Application code contains error at 12/02/2021 08:20:10.100
--------------------------------------
--------------------------------------
Timeline: 24/02/2021 10:20:12.667
Message Details - Application code contains error at 24/02/2021 07:10:23.112
--------------------------------------

 

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

If you want to keep the lines (I don't understand why, since they're of little value), then remove the SEDCMD and use this line breaker.

LINE_BREAKER = --+([\r\n]+)--+
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...