Getting Data In

How to set custom user provided timestamp as the Splunk timestamp while logging to Splunk?

abhishek_singh
Loves-to-Learn

I have a use case in which our user sends us logs in batches in which each individual logs have their own timestamp(when they would have occurred), which we then log individually to the splunk using serilog.sinks.splunk in .net 6.

What we are trying to do is replace the automatically generated logging time in splunk with the original timestamp that we received from our user.

Is this possible in splunk ? and if so then how.

Labels (2)
0 Karma

woodcock
Esteemed Legend

Create a props.conf on your indexers to do the Magic8:
https://kinneygroup.com/blog/splunk-magic-8-props-conf/

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Between reading data from the source and writing it to Splunk using serilog.sinks.splunk, you can do anything you want, including replacing the event timestamp.

Be sure the Splunk sourcetype for the data has settings to properly find and interpret the new timestamp. (Don't use DATETIME_CONFIG = current, for example).

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

abhishek_singh
Loves-to-Learn


@richgalloway :
My apologies if this is a trivial question i am quite new to splunkWhere is this setting for DATETIME_CONFIG present and how can we edit it. Can we do this on the fly using the  serilog.sinks.splunk.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

DATETIME_CONFIG is one of many settings available in props.conf files on your indexers and heavy forwarders (if any).  It's unlikely it can be set using serilog.sinks.splunk.

See https://docs.splunk.com/Documentation/Splunk/9.0.4/Admin/Propsconf#:~:text=Timestamp%20extraction%20...

---
If this reply helps you, Karma would be appreciated.
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 ...