Splunk Search

DB Connect MS SQL Datetime

devicenul1
Path Finder

Splunk not reading my datetime value correctly:

select top 1 convert(datetime,posting_date) as PostedDate

Result:
PostedDate: 2005-12-08 08:26:00.000

Following the steps in the documentation this should be all I need to do, but it's not working. Instead Splunk is indexing the event based on the date / time of the Splunk server.

I also tried following the workaround suggested in the documentation:
output.timestamp.parse.format = yyyy-mm-dd hh:MM:ss.SSS

and it still doesn't work, just not sure what I'm missing.

Updated inputs.conf

[dbmon-tail://RO_DB/PostedOrders]
host = DBSRVR
index = DBIndex
interval = 2m
output.format = kv
output.timestamp = 1
output.timestamp.column = por_POSTING_DATE
query = SELECT por_POSTING_DATE,por_ORD_KEY,por_POSTING_DATE as PostedDate from table {{WHERE $rising_column$ > ?}}
sourcetype = PostedOrders
tail.rising.column = por_ORD_KEY
table = PostedOrders
disabled = 0
output.timestamp.format = yyyy-mm-dd hh:MM:ss

Updated Props.conf

[PostedOrders]
MAX_DAYS_AGO = 5000
TIME_FORMAT=%s

linu1988
Champion

no it is not necessary as you rightly said , output.timestamp = 1 then you need the format else all the config is fine and the output.timestamp doesn't affect the input. Just try dump your data into some default index to see if it works.

More than that just check in dbx.log what exactly is happening... Please come back if you see any issue 🙂

0 Karma

devicenul1
Path Finder

the posting_date column is in the smalldatetime format without the convert() the data returns a bit differently(result: 2008-05-09 10:30:00) so should my inputs.conf look like this:

output.timestamp=1
output.timestamp.column = PostedDate
output.timestamp.format = yyyy-mm-dd hh:MM:ss
query= select top 10 posting_date as PostedDate from table

Is the timestamp.format of dd/mm/yyy hh:MM:ss in your config because splunk wants it that way? I see you also have an output.timestamp of =0 so is the .format line even necessary?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Make Your Machine Data AI-Ready in Splunk

Every team is getting ready for AI agents.   Thursday, November 12, 2026  |  11AM  PST / 2PM EST   ...

Splunk Asynchronous Forwarding Explained

Splunk asynchronous forwarding is often misunderstood as simply setting autoLBVolume. That is not quite right. ...

How to Monitor AI Agents with Splunk Agent Observability

Let’s say I’m running a travel planning AI app in production. A user asks for three concise hotel options in ...