Splunk Search

Time Chart and DBXquery

shubhamkanugo
New Member

I am new to splunk. I have a DB connection from where I am fetching a table. I want to create a dashboard for with x-axis as time and Y-axis as count of table in every hour.
i tried with timechart function but I am unable to achive my goal. I am getting data without timechart.

| dbxquery query="SELECT * FROM \"CASE\"" | timechart count by Id

this is my query.

Tags (1)
0 Karma

to4kawa
Ultra Champion
| makeresults
| eval _raw="XYZ 521463 PQR LMN 2012-09-14 18:13:12.919648"
| rex "(?<time>\d{4}-\d{2}-\d{2} \S+$)"
| eval _time =strptime(time,"%F %T.%6Q")
| timechart count

I am not sure id , you should extract from the result.

0 Karma

to4kawa
Ultra Champion

Can you provide the result, | dbxquery query="SELECT * FROM \"CASE\""?

0 Karma

shubhamkanugo
New Member

update:
Instead of * it is count(1) in query so it is giving number of rows as result.

| dbxquery query="SELECT count(1) FROM \"CASE\"" | timechart count by Id

@to4kawa

0 Karma

to4kawa
Ultra Champion

@shubhamkanugo

timechart needs epoch time value.
so, I say again,
Can you provide the result, | dbxquery query="SELECT * FROM \"CASE\"" ?

0 Karma

shubhamkanugo
New Member

@to4kawa
I will not be able to provide results but you can consider result of any general table like person or organization having ID and timestamps also as columns.

0 Karma

to4kawa
Ultra Champion

I see and don't want such sensitive data.
but you can't provide sample?

0 Karma

shubhamkanugo
New Member

XYZ 521463 PQR LMN 2012-09-14 18:13:12.919648

Above is the sample row we get from that query, last column is time stamp with date.
@to4kawa

0 Karma

shubhamkanugo
New Member

@to4kawa
Hi If you are OK it will be more comfortable for me to understand your answer with some explanation.

0 Karma

to4kawa
Ultra Champion

If you are not sure rex , check regex101
if you are not sure other SPL, try Fundametal 1

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!

Casting Call: Compete in Cyber Games

Lights, Camera, SecOps: Apply to Compete in Cyber Games     Think you have what it takes to beat the clock? ...

Data Management Digest – June 2026

Welcome to the June 2026 edition of Data Management Digest! This month’s update is short and sweet, with a ...

Think Like an Architect: Introducing the Splunk Certified Cybersecurity Defense ...

In cybersecurity, defenders respond to threats. Architects design the systems that stop them.    As ...