Getting Data In

DB Connect not parsing timestamp properly

adityapavan18
Contributor

Hi ir-respective of what timestamp is present in timestamp column of my Oracle DB, the timestamp in the event is replaced to "1970-01-01 00:59:59".

In oracle DB the timestamp column contains data like 2013-09-19T14:31:12

and the configuration in my inputs.conf is

    [dbmon-tail://SAMPLE/SPLUNK_USER.SAMPLEINPUT]
host = testhost
interval = * * * * *
output.format = kv
output.timestamp = 1
output.timestamp.column = PAYLOADDATE
output.timestamp.parse.format = yyyy-MM-dd HH:mm:ss
sourcetype = test_st
table = SPLUNK_USER.SAMPLEINPUT
tail.rising.column = PAYLOADDATE
index = default
query = SELECT * FROM SAMPLEINPUT {{WHERE $rising_column$ > ?}}
output.timestamp.format = yyyy-MM-dd HH:mm:ss

Note: PAYLOADDATE column is a varchar2 type

Can you please highlight what i am doing wrong?

0 Karma
1 Solution

lukejadamec
Super Champion

For your output and output parse formats, have you tried:

yyyy-MM-dd'T'HH:mm:ss

View solution in original post

0 Karma

jcoates_splunk
Splunk Employee
Splunk Employee

what is the column type in your database? have you tried adding a SQL cast or convert to your SQL statement?

0 Karma

lukejadamec
Super Champion

For your output and output parse formats, have you tried:

yyyy-MM-dd'T'HH:mm:ss
0 Karma

lukejadamec
Super Champion

You're welcome.

0 Karma

lukejadamec
Super Champion

??? When you save the input configuration it should reset the connection and create log entries. If there are no errors, then you should see something like:
INFO:TailDatabaseMonitor - Database monitor - your input - finshed with status=true resultCount=xxx in duration=xxxxms
and
Scheduler - Execution of input= your db input finished in duration=xxx with resultCount=xxx success=true continuemonitoring=true.
But that means it is working.

0 Karma

adityapavan18
Contributor

My mistake i used only T changed it to 'T' its working now thnx

adityapavan18
Contributor

there are no errors in dbx logs

0 Karma

lukejadamec
Super Champion

What is the error in the dbx log?

0 Karma

adityapavan18
Contributor

then nothing gets indexed

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!

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...