<?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 add custom start date and end date in splunk query (without the using splunk default date picker) ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430918#M123176</link>
    <description>&lt;P&gt;Hi @sajithpm101,&lt;/P&gt;

&lt;P&gt;You can provide the earliest and latest time in the SearchManager object itself.&lt;BR /&gt;
Like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var searchFunctionalAreas = new SearchManager({
        id: "functional-areas",
        earliest_time: startdate_in_epochs,
        latest_time: enddate_in_epochs,
        preview: true,
        cache: false,
        search: 'your search here...'
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Tell me if I am missing something.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2019 12:36:38 GMT</pubDate>
    <dc:creator>harshpatel</dc:creator>
    <dc:date>2019-06-24T12:36:38Z</dc:date>
    <item>
      <title>How to add custom start date and end date in splunk query (without the using splunk default date picker) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430911#M123169</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have to pass a custom 'startdate' and 'enddate' in Splunk query in the search tab (without the help of Splunk default date picker which is available in the Splunk app search tab). &lt;BR /&gt;
Anyone can show me an example with a basic search which will work in Splunk search (page)?  &lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 07:56:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430911#M123169</guid>
      <dc:creator>sajithpm101</dc:creator>
      <dc:date>2019-06-21T07:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add custom start date and end date in splunk query (without the using splunk default date picker) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430912#M123170</link>
      <description>&lt;P&gt;Hi @sajithpm101,&lt;/P&gt;

&lt;P&gt;You can use the &lt;CODE&gt;addinfo&lt;/CODE&gt; command to include all the search info to your results :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | addinfo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will add the time you ran the search along with the min and max time you are looking for.&lt;/P&gt;

&lt;P&gt;More info on &lt;CODE&gt;addinfo&lt;/CODE&gt; here :&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Addinfo"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Addinfo&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 09:52:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430912#M123170</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-21T09:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to add custom start date and end date in splunk query (without the using splunk default date picker) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430913#M123171</link>
      <description>&lt;P&gt;This question does not provide enough information.&lt;BR /&gt;
Where are you passing the custom 'startdate' and 'enddate'?&lt;BR /&gt;
What are you searching for?&lt;BR /&gt;
What's the context of your question in regards to your data?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 19:29:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430913#M123171</guid>
      <dc:creator>jnudell_2</dc:creator>
      <dc:date>2019-06-21T19:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to add custom start date and end date in splunk query (without the using splunk default date picker) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430914#M123172</link>
      <description>&lt;P&gt;@jnudell_2 Below I have mention more details about my question. Please go through that. &lt;/P&gt;

&lt;P&gt;Example query: "index=_internal | stats count by sourcetype"&lt;/P&gt;

&lt;P&gt;I want to know is there any way to pass 'startdate' and 'enddate' on the above mentioned Splunk query. &lt;BR /&gt;
for example 01/05/2019 (startdate) to 04/05/2019 (enddate) in Splunk search tab page.&lt;BR /&gt;
If that is not possible in this query then please show me how to do that in any other query.&lt;/P&gt;

&lt;P&gt;I am using a custom js page for calling Splunk queries. I have mentioned a sample below &lt;/P&gt;

&lt;P&gt;var mySearch = new SearchManager({&lt;BR /&gt;
        id: "mysearch",&lt;BR /&gt;
        preview: true,&lt;BR /&gt;
        cache: false,&lt;BR /&gt;
        search: mvc.tokenSafe('index=_internal | stats count by sourcetype')&lt;BR /&gt;
    });&lt;/P&gt;

&lt;P&gt;So if you help me how to achieve 'startdate' and 'enddate' in splunk query(manually) I can run that query in js file and check the data is loading or not.&lt;/P&gt;

&lt;P&gt;Thanks in Advance.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 07:42:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430914#M123172</guid>
      <dc:creator>sajithpm101</dc:creator>
      <dc:date>2019-06-24T07:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to add custom start date and end date in splunk query (without the using splunk default date picker) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430915#M123173</link>
      <description>&lt;P&gt;@sajithpm101, did you try using &lt;CODE&gt;addinfo&lt;/CODE&gt; as suggested ? &lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 07:57:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430915#M123173</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-24T07:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to add custom start date and end date in splunk query (without the using splunk default date picker) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430916#M123174</link>
      <description>&lt;P&gt;@DavidHourani Thanks for your answer. It was new knowledge for me.&lt;/P&gt;

&lt;P&gt;But actually, this is not I want. I would like to clear my question little more deeply. &lt;BR /&gt;
for example, I have a basic query that I have mentioned below.&lt;/P&gt;

&lt;P&gt;example query: 'index=_internal | stats count by sourcetype' . &lt;/P&gt;

&lt;P&gt;I want to know how can I apply the startdate and endate for this query (01/05/19 to 04/05/19) in splunk search page. Right now if I write the query in Splunk search page it will run based on the date range which I have given in the Splunk default date picker. Instead of this what is the custom range date i have given in the search bar with a query should give the result. &lt;/P&gt;

&lt;P&gt;I think now you can clearly understand my requirement.&lt;/P&gt;

&lt;P&gt;Thanks in Advance&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 10:33:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430916#M123174</guid>
      <dc:creator>sajithpm101</dc:creator>
      <dc:date>2019-06-24T10:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to add custom start date and end date in splunk query (without the using splunk default date picker) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430917#M123175</link>
      <description>&lt;P&gt;Hi @sajithpm101,&lt;/P&gt;

&lt;P&gt;Got it!&lt;/P&gt;

&lt;P&gt;So by default when you save a search to a dashboard it will use the current time of the search you created. You can click on edit search on the dashboard and change that if needed.&lt;/P&gt;

&lt;P&gt;Another easy way to control this time is to save your search as a report including the time. They reuse that report wherever needed on that time frame.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 11:08:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430917#M123175</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-24T11:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to add custom start date and end date in splunk query (without the using splunk default date picker) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430918#M123176</link>
      <description>&lt;P&gt;Hi @sajithpm101,&lt;/P&gt;

&lt;P&gt;You can provide the earliest and latest time in the SearchManager object itself.&lt;BR /&gt;
Like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var searchFunctionalAreas = new SearchManager({
        id: "functional-areas",
        earliest_time: startdate_in_epochs,
        latest_time: enddate_in_epochs,
        preview: true,
        cache: false,
        search: 'your search here...'
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Tell me if I am missing something.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 12:36:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430918#M123176</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2019-06-24T12:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to add custom start date and end date in splunk query (without the using splunk default date picker) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430919#M123177</link>
      <description>&lt;P&gt;If I am understanding your question correctly you looking for "earliest" and "latest" parameters:&lt;BR /&gt;
index=_internal earliest="06/24/2019:0:0:0" latest="06/24/2019:23:59:59"&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 13:40:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430919#M123177</guid>
      <dc:creator>gportnoy</dc:creator>
      <dc:date>2019-06-24T13:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to add custom start date and end date in splunk query (without the using splunk default date picker) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430920#M123178</link>
      <description>&lt;P&gt;If I am understanding your question correctly you looking for "earliest" and "latest" parameters:&lt;BR /&gt;
index=_internal earliest="06/24/2019:0:0:0" latest="06/24/2019:23:59:59"&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 13:55:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430920#M123178</guid>
      <dc:creator>gportnoy</dc:creator>
      <dc:date>2019-06-24T13:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to add custom start date and end date in splunk query (without the using splunk default date picker) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430921#M123179</link>
      <description>&lt;P&gt;@gportnoy Thanks for your answer. &lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 06:00:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430921#M123179</guid>
      <dc:creator>sajithpm101</dc:creator>
      <dc:date>2019-06-25T06:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to add custom start date and end date in splunk query (without the using splunk default date picker) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430922#M123180</link>
      <description>&lt;P&gt;@gportnoy  Thanks for the Answer.&lt;/P&gt;

&lt;P&gt;index=_internal earliest="05/26/2019:12:00:00" latest="06/25/2019:12:03:00" | stats count by sourcetype&lt;/P&gt;

&lt;P&gt;This is working well. I need to do some customization for using the queries in my custom js file.  &lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 06:52:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-custom-start-date-and-end-date-in-splunk-query/m-p/430922#M123180</guid>
      <dc:creator>sajithpm101</dc:creator>
      <dc:date>2019-06-25T06:52:20Z</dc:date>
    </item>
  </channel>
</rss>

