<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to query Splunk API to only search for data for a particular time range? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-query-Splunk-API-to-only-search-for-data-for-a-particular/m-p/187020#M53882</link>
    <description>&lt;P&gt;I'm not sure if you are using the Splunk SDK for C# or not. However if you are there is a class called JobArgs that the CreateAsync method will accept which allows you to specify the earliest and latest time.&lt;/P&gt;

&lt;P&gt;Here is an example of the creation method using the class:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Job job = await service.Jobs.CreateAsync(search, 0, ExecutionMode.Normal, new JobArgs{ EarliestTime = "@d", LatestTime = "now"}, null, DispatchState.Running).ConfigureAwait(false);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 05 May 2015 19:44:44 GMT</pubDate>
    <dc:creator>swbodie</dc:creator>
    <dc:date>2015-05-05T19:44:44Z</dc:date>
    <item>
      <title>How to query Splunk API to only search for data for a particular time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-query-Splunk-API-to-only-search-for-data-for-a-particular/m-p/187017#M53879</link>
      <description>&lt;P&gt;i am trying to query splunk api from a c# application for a particular DateTime Range using below query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search index=iis host=wssecure* earliest=\"01/15/2015:09:00:00\" latest=\"01/15/2015:09:05:00\" | head 2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but what splunk is doing is that it runs the query for the DateTime range of &lt;EM&gt;earliest&lt;/EM&gt; till &lt;EM&gt;now&lt;/EM&gt; and then returns the data that falls between the dateTime range of &lt;EM&gt;earliest&lt;/EM&gt; to &lt;EM&gt;latest&lt;/EM&gt; (as specified in the query).&lt;BR /&gt;
Due to this if the user wants to get the data in span of 15 min for a particular day in last week, splunk takes forever to return the data as the number of events to scan through is too large.&lt;/P&gt;

&lt;P&gt;is there a way to query splunk api and make it scan data only for particular time frame?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2015 05:29:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-query-Splunk-API-to-only-search-for-data-for-a-particular/m-p/187017#M53879</guid>
      <dc:creator>rrahul963</dc:creator>
      <dc:date>2015-01-20T05:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to query Splunk API to only search for data for a particular time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-query-Splunk-API-to-only-search-for-data-for-a-particular/m-p/187018#M53880</link>
      <description>&lt;P&gt;I am also having this issue using Python. Using the Last 15 Minutes example above, the Web UI generates a URL containing &lt;CODE&gt;'earliest=-15m&amp;amp;latest=now'&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I pass those parameters in JSON format exactly as it is displayed. Anybody have clues?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;{'earliest':'-15m', 'latest':'now'}&lt;/CODE&gt; when executed returns ALL TIME, not last 15 minutes.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Feb 2015 23:21:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-query-Splunk-API-to-only-search-for-data-for-a-particular/m-p/187018#M53880</guid>
      <dc:creator>D2KSec1</dc:creator>
      <dc:date>2015-02-21T23:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to query Splunk API to only search for data for a particular time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-query-Splunk-API-to-only-search-for-data-for-a-particular/m-p/187019#M53881</link>
      <description>&lt;P&gt;I am having exactly the same problem using the REST API in Python. Any help will be greatly appreciated&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2015 17:19:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-query-Splunk-API-to-only-search-for-data-for-a-particular/m-p/187019#M53881</guid>
      <dc:creator>nikos_d</dc:creator>
      <dc:date>2015-05-05T17:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to query Splunk API to only search for data for a particular time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-query-Splunk-API-to-only-search-for-data-for-a-particular/m-p/187020#M53882</link>
      <description>&lt;P&gt;I'm not sure if you are using the Splunk SDK for C# or not. However if you are there is a class called JobArgs that the CreateAsync method will accept which allows you to specify the earliest and latest time.&lt;/P&gt;

&lt;P&gt;Here is an example of the creation method using the class:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Job job = await service.Jobs.CreateAsync(search, 0, ExecutionMode.Normal, new JobArgs{ EarliestTime = "@d", LatestTime = "now"}, null, DispatchState.Running).ConfigureAwait(false);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 May 2015 19:44:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-query-Splunk-API-to-only-search-for-data-for-a-particular/m-p/187020#M53882</guid>
      <dc:creator>swbodie</dc:creator>
      <dc:date>2015-05-05T19:44:44Z</dc:date>
    </item>
  </channel>
</rss>

