Splunk Search

How do I get the second datetime from the following log ?

vikas_gopal
Builder

Hi Expert,

I have the below log. In this, I have 2 different time with different formats. I need to set a second date and time at the time of source type selection. I used the below settings, but I am getting the below warning.

Can anyone tell me what is missing here?

Log Sample

[167154] 2018-11-13 00:43:26 Received fatal signal 6 (Aborted).  Cause:   Signal sent by PID 4679 running under UID 1687.  Crashing thread: Main Thread   OS: Linux  Arch: x86-64
 Backtrace:
 Linux / usr13.eng.buttercupgames.com / 2.6.32-279.5.2.el6.x86_64 / #1 SMP Fri Aug 24 01:07:11 UTC 2013 / x86_64

I need to select Fri Aug 24 01:07:11 UTC 2013.

Sourcetype Settings

[ abc ]  
SHOULD_LINEMERGE=true 
NO_BINARY_CHECK=true 
TIME_FORMAT=%a %b %d %H:%M:%S %Z%z %Y 
TIME_PREFIX=SMP\s

With the above settings, things looks good, but I can see one warning in the data preview screen. It says:

Could not use stptime to parse timestamp from "Fri Aug 24 01:07:11 UTC 2013 / x86_64"
Tags (1)
0 Karma
1 Solution

FrankVl
Ultra Champion

I think the issue is with: %Z%z. I think that should be just %Z?

View solution in original post

0 Karma

FrankVl
Ultra Champion

I think the issue is with: %Z%z. I think that should be just %Z?

0 Karma

vikas_gopal
Builder

Well I tried with only %Z ,with this I can see 2 lines as Splunk split the record in 2 one with the first time and second with the mentioned format date basis which is wrong (11/13/18 11:02:23.000 PM and 8/24/13 6:37:11.000 AM). It should be one line only

0 Karma

FrankVl
Ultra Champion

That sounds more like an issue with your linebreaking config than anything else.

Try:

SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)\[\d+\]

And perhaps see if you can share a screenshot of the results you got with %Z, (and the raw data that was used for that test).

0 Karma

vikas_gopal
Builder

Wow Line Break logic works like a charm but Can you help me to understand why was that , why we need line break here ?

0 Karma

FrankVl
Ultra Champion

Not entirely sure, as I don't fully understand your description of how it failed. But in general, when you set should_linemerge to true and leave other related settings to default, the way Splunk detects which lines to combine into a single event and where to split between separate events is dependent on where it detects the timestamp. And especially for multiline events, that may not always be how you want it to behave.

In general using an explicit LINE_BREAKER (and setting SHOULD_LINEMERGE to false) is better for performance and to my opinion also makes the whole process more predictable.

You can have a look at the props.conf spec for more details on how those settings interact: http://docs.splunk.com/Documentation/Splunk/latest/Admin/propsconf#Line_breaking

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