Splunk Search

First instance of timestamp

mirsmehdi
New Member

Trying to get the first occurrence of the timestamp to be used for _time

LogFile:
2016/05/27 06:30; 2016/05/27 06:29:18 Test1 :Service1
2016/05/27 05:30; 2016/05/27 05:24:16 Test2 :Service2

Have used props.conf to use MAX_TIMESTAMP_LOOKAHEAD=15, and also TIME_PREFIX = ^; still looks at the second timestamp

inputs.conf:

[monitor:LogFile]
index = test_index
sourcetype = sourcetype_new
source = host1

props.conf

[sourcetype_new]
TIME_PREFIX = ^
MAX_TIMESTAMP_LOOKAHEAD = 15

search:

source=host1 sourcetype=sourcetype_new *

Output:

Time                                -  Event
2016/05/27 06:29:18       - 2016/05/27 06:30; 2016/05/27 06:29:18 Test1 :Service1
2016/05/27 05:24:16       - 2016/05/27 05:30; 2016/05/27 05:24:16 Test2 :Service2
Tags (1)
0 Karma

ryanoconnor
Builder

Also keep in mind 2016/05/27 06:30 is 16 characters, so you might want to change your max_timestamp_lookahead to 16.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try adding TIME_FORMAT = %Y/%m/%d %H:%M to your sourcetype_new stanza.

---
If this reply helps you, Karma would be appreciated.
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...