Splunk Search

dbconnect timestamp

sbsbb
Builder

I've a DBconnect on a MSSQL

My Timestamp in the DB looks like this : 2013-04-04 15:24:36.7170000

I've defined the folowing
output.timestamp.format = "yyyy-MM-dd HH:mm:ss.SSS"
output.timestamp.parse.format = "yyyy-MM-dd HH:mm:ss.SSS"

The output from Splunk is
1970-01-01 00:59:59.999 !

I've tried to truncate the input to 2013-04-04 15:24:36.717 first, but same result

Lazarix
Communicator

You can also do:

| convert timeformat="%Y/%m/%d" ctime(name of your date column) as NEWDATE

substitute the %Y/%m/%d for whatever time periods you want to show up.

0 Karma

Lazarix
Communicator

The alternative is to define a search macro for it instead.
I've found that there is no global way for Splunk to parse MySQL or MSSQL timestamps

0 Karma

sbsbb
Builder

ok that will always work, the same for a to_char in sql... but I doesn't want to make that for each date field and for each query...

0 Karma

sbsbb
Builder

I've found some possibility in oracle : alter session set NLS_DATE_FORMAT='DD-MON-YY'

But I'm not able to use that command in DBquery

0 Karma

sbsbb
Builder

I've found some possibility in oracle :
alter session set NLS_DATE_FORMAT='DD-MON-YY'

But I'm not able to use that command in DBquery

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!

Community Content Calendar, September edition

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

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...