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

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...