Getting Data In

DBConnect changing the date column value automatically to wrong date

pradeepkumarg
Influencer

When I'm querying the data using DBQuery in DBConnect the data is being shown as below

776569  1406755920.000  abc xyz

While the actual data is as below


776569 2014-07-30 17:32:00 abc xyz

The date is being converted to epoch value automatically and also the epoch time is wrong..

This is causing problem to my DBinputs

0 Karma
1 Solution

pmdba
Builder

You can use a SQL function to convert the date to character format that Splunk will recognize. In Oracle this would be something like this:

select to_char(date_field,'YYYY-MM-DD HH24:MI:SS'), other_columns from your_table;

View solution in original post

pmdba
Builder

You can use a SQL function to convert the date to character format that Splunk will recognize. In Oracle this would be something like this:

select to_char(date_field,'YYYY-MM-DD HH24:MI:SS'), other_columns from your_table;

jvspradyumna
Engager

Thanks man! It worked for me as well. Do you know why does it happen that the dates get these kind of values? What value is that?

0 Karma

mchang_splunk
Splunk Employee
Splunk Employee

will it be timezone issue?

0 Karma

jvspradyumna
Engager

I am skeptical about that as splunk can capture current time when you are indexing data. Not sure how to get rid of this issue.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...