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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...