Splunk Search

how to write _time function to take the data for all 7 days ( i mean in between days too )

umsundar2015
Path Finder

Hi,

I have scenario like having timechart to show spikes for different dates(ex for 7 days).But now it shows same value for all 7 days.

I have intro_max_time and intro_min_time in the format (1477480327.000 which pertains todays date).The condition which i gave is eval _time=info_max_time which takes only today data (ie intro_max_time) .

I want to write this eval function for comparing the data for all the days between this intro_max_time and intro_min_time for getting the spikes.

Please suggest me .

Tags (1)
0 Karma
1 Solution

sundareshr
Legend

As long as your events have correct values for _time field, you don't need | addinfo | eval _time=intro_max_time. Try this instead.

index=foo sourcetype=bar | timechart span=1d cont=t count by remark_status

View solution in original post

0 Karma

sundareshr
Legend

As long as your events have correct values for _time field, you don't need | addinfo | eval _time=intro_max_time. Try this instead.

index=foo sourcetype=bar | timechart span=1d cont=t count by remark_status
0 Karma

umsundar2015
Path Finder

i am getting no results .

what is the use of cont=t ???

0 Karma

sundareshr
Legend

cont: Specifies whether the chart is continuous or not. If set to true, the Search application fills in the time gaps. What do you get when you run this query

index=foo sourcetype=bar earliest=-7d@d | dedup _time | table _time remark_status _raw

http://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Timechart

sundareshr
Legend

Please share your query.

0 Karma

umsundar2015
Path Finder

| addinfo | eval _time=intro_max_time |timechart span=1d count by remark_status .

iam selecting time range as last 7 days..

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 ...