Splunk Search

How do I get a time curve with field values?

WXY
Path Finder

Hello.

Now, I must get a time curve using a field value .

My data has these fields:_time,CreateDate

There is a data : 2018-09-18 20:30:04 , CreateDate="2018-09-18 01:04:19.95", EndDate="2018-09-18 09:16:47.813"

"2018-09-18 20:30:04 " is _time,

"2018-09-18 01:04:19.95" is CreateDate,

I want to get a time curve using the CreateDate field.

What should I do ?

Tags (3)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi WXY,
if you want to span events every hour, try something like this:

your_search
| eval CreateDate=strptime(CreateDate,"%Y-%m-%d %H:%M:%S.%N")
| bin span=1h CreateDate
| stats count BY CreateDate
| eval CreateDate=strftime(CreateDate,"%Y-%m-%d %H:%M:%S.%N")

Bye.
Giuseppe

0 Karma

renjith_nair
SplunkTrust
SplunkTrust

@WXY,

Try

"your search" |eval _time=strptime(CreateDate,"%Y-%m-%d %H:%M:%S.%N") |timechart "field you want to chart"
Happy Splunking!
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...