Refine your search:

2
2

i have one question I want to search time Daily from 9 am to 6:00 pm How can to use search command ?

Thank you for your help

CT

asked 06 May '10, 09:08

shirolu's gravatar image

shirolu
153
accept rate: 0%

Can you clarify whether you want to a) run your search once per day, and have it search over events from that particular workday, or b) run your search over several days and only match events between 9am and 6pm on those days. Both are possible and both paths are outlined in the answers below

(09 May '10, 16:57) nick ♦

5 Answers:

If you want to search just one particular day, between 9am and 6pm, do as some others have suggested here and use the relative time syntax:

In the TimeRangePicker pulldown, choose 'Custom time', then 'advanced', then in the two form fields that come up, enter on the left side:

@d+9h 

and enter on the right side

@d+18h

However you have said you want to search this timerange every day. Someone else here has interpreted this to mean you want to run this search once every day as an alert.

However you can search over several days or more but restrict your results to just events during working hours by using the date_hour field like this:

<your search> date_hour>9 date_hour<18

This search can then be run over any timerange (like current business week), and it will match only events that occurred during working hours within that timerange.

More docs and examples about time range arguments can be found here: http://www.splunk.com/base/Documentation/4.1.2/User/ChangeTheTimeRangeOfYourSearch

link

answered 09 May '10, 16:54

nick's gravatar image

nick ♦
14.2k1318
accept rate: 47%

edited 11 May '10, 06:27

You can use relative time modifiers in your search term. For your specific question, for a work day of 9am to 6pm, you could specify the following:

earliest=@d+9h latest=@d+18h

link

answered 07 May '10, 04:59

sajbutler's gravatar image

sajbutler
21114
accept rate: 0%

Keep in mind that this is a new feature in Splunk 4.1.

(11 May '10, 20:23) Lowell ♦

No answer here - I have the same question. I changed the date range through the custom time dropdown box and that works. It gives me events in the correct date range, but not the correct time range. I then added the modifiers below to the query and I get no results.

date_hour>9 date_hour<18

Any suggestions? Trying to limit my search to the previous 5 days between 5am and 9am. I can get the previous 5 days through the dropdown box but I am unable to limit the time range.

link

answered 21 Jul '10, 14:42

jumpe1414's gravatar image

jumpe1414
111
accept rate: 0%

-1

hi ~ chris Thank you for your help if everyday starttime 09:00:00 to endtime 18:0:00 How to use this search command

CT

link

answered 06 May '10, 11:44

shirolu's gravatar image

shirolu
153
accept rate: 0%

it's much better to edit your original question or comment on someone's answer. Posting a comment as an answer to your own question is a little weird - its best to delete this.

(09 May '10, 16:59) nick ♦
-1

hi ~ chris

I understand your explanation

Thanks for your help

CT

link

answered 06 May '10, 14:36

shirolu's gravatar image

shirolu
153
accept rate: 0%

Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1,083
×196

Asked: 06 May '10, 09:08

Seen: 1,423 times

Last updated: 21 Jul '10, 14:42

Copyright © 2005-2012 Splunk, Inc. All rights reserved.