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
Get Updates on the Splunk Community!

Community Content Calendar, November Edition

Welcome to the November edition of our Community Spotlight! Each month, we dive into the Splunk Community to ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...

Stay Connected: Your Guide to November Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...