<?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: search query to get specific date range events from different field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236912#M70403</link>
    <description>&lt;P&gt;Hello Giuseppe,&lt;/P&gt;

&lt;P&gt;ya, its has the id_num which can use for join&lt;/P&gt;</description>
    <pubDate>Thu, 24 Nov 2016 09:18:16 GMT</pubDate>
    <dc:creator>snehalk</dc:creator>
    <dc:date>2016-11-24T09:18:16Z</dc:date>
    <item>
      <title>search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236906#M70397</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;

&lt;P&gt;I have requirement where need to compare the two different date's and condition is that date would be one year and two months from respective field.&lt;/P&gt;

&lt;P&gt;eg: consider two sourcetype followed by sourcetype="xyz" and sourcetype="abc"  and each sourcetype contain date field called "mydate". So requirement is need to fetch the events from "abc" where the date field "mydate"  is different and that date should be within one year and two months from  "xyz" sourcetype date field "mydate".&lt;/P&gt;

&lt;P&gt;Can any one guide me on this?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 09:49:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236906#M70397</guid>
      <dc:creator>snehalk</dc:creator>
      <dc:date>2016-11-23T09:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236907#M70398</link>
      <description>&lt;P&gt;Hi snehalk,&lt;BR /&gt;
it's not so clear your requirement:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;you have events from two sourcetypes,&lt;/LI&gt;
&lt;LI&gt;field mydate is present in all events of both sourcetypes,&lt;/LI&gt;
&lt;LI&gt;when you say &lt;CODE&gt;where the date field "mydate" is different&lt;/CODE&gt;, do you mean different by what?&lt;/LI&gt;
&lt;LI&gt;when you say  &lt;CODE&gt;that date should be within one year and two months from "xyz" sourcetype date field "mydate"&lt;/CODE&gt;, do you mean from the first, the last or what date of "xyz" sourcetype?&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 10:55:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236907#M70398</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-11-23T10:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236908#M70399</link>
      <description>&lt;P&gt;Hello Giuseppe,&lt;/P&gt;

&lt;P&gt;Thank you for response, below are my answers for each doubt you have.  &lt;/P&gt;

&lt;P&gt;you have events from two sourcetypes,&lt;BR /&gt;
Ans: Yes, i have two different sourcetype&lt;/P&gt;

&lt;P&gt;field mydate is present in all events of both sourcetypes,&lt;BR /&gt;
Ans: Yes. Its present in both the sourcetypes&lt;/P&gt;

&lt;P&gt;when you say where the date field "mydate" is different, do you mean different by what?&lt;BR /&gt;
Ans: different by date&lt;/P&gt;

&lt;P&gt;when you say that date should be within one year and two months from "xyz" sourcetype date field "mydate", do you mean from the first, the last or what date of "xyz" sourcetype?&lt;BR /&gt;
Ans: it means the events(result) from "abc" should be within range of (ie one year two months) from "xyz" sourcetype field "mydate". &lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 12:33:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236908#M70399</guid>
      <dc:creator>snehalk</dc:creator>
      <dc:date>2016-11-23T12:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236909#M70400</link>
      <description>&lt;P&gt;about the last point: from first or last event of "xyz"?&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 13:24:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236909#M70400</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-11-23T13:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236910#M70401</link>
      <description>&lt;P&gt;that would be comparing each event (date) with other event.                                                                                     eg: sourcetype="xyz"  mydate (2013)  sourcetype="abc"  mydate (2016)  then take the "abc" event &lt;/P&gt;

&lt;P&gt;if  sourcetype="xyz"  mydate (2010)  sourcetype="abc"  mydate (2016)  then dont take "abc" event&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 14:08:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236910#M70401</guid>
      <dc:creator>snehalk</dc:creator>
      <dc:date>2016-11-23T14:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236911#M70402</link>
      <description>&lt;P&gt;Is there a field to join the two searches?&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 15:30:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236911#M70402</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-11-23T15:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236912#M70403</link>
      <description>&lt;P&gt;Hello Giuseppe,&lt;/P&gt;

&lt;P&gt;ya, its has the id_num which can use for join&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2016 09:18:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236912#M70403</guid>
      <dc:creator>snehalk</dc:creator>
      <dc:date>2016-11-24T09:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236913#M70404</link>
      <description>&lt;P&gt;try something like this:&lt;BR /&gt;
index=yourindex sourcetype="xyz"  | eval mydate1=mydate | join id_num  [ search index=yourindex sourcetype="abc" | eval mydate2=mydate  ] | eval mydate1=strptime(mydate1,"your_format"), mydate2=strptime(mydate2,"your_format") | eval diff=mydate1-mydate2 | where diff&amp;lt;36720000&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:55:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236913#M70404</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-29T11:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236914#M70405</link>
      <description>&lt;P&gt;Hello Giuseppe,&lt;/P&gt;

&lt;P&gt;Thank you for search query. Could you please explain what is mean by 36720000? and why we are using here? &lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 10:55:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236914#M70405</guid>
      <dc:creator>snehalk</dc:creator>
      <dc:date>2016-11-28T10:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236915#M70406</link>
      <description>&lt;P&gt;Hi snehalk,&lt;BR /&gt;
you asked to have events in the last year + 2 months, so 36720000 is&lt;BR /&gt;
60x60x24x(365 + 60)&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 11:05:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236915#M70406</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-11-28T11:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236916#M70407</link>
      <description>&lt;P&gt;Hello Giuseppe,&lt;/P&gt;

&lt;P&gt;thank you so much, when i search the query am getting in "diff" column some date with 1970 year value  so how to identify the value am getting is correct? because there are many events? is there any ways for that?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 11:50:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236916#M70407</guid>
      <dc:creator>snehalk</dc:creator>
      <dc:date>2016-11-28T11:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236917#M70408</link>
      <description>&lt;P&gt;Hi snehalk,&lt;BR /&gt;
You could follow the same method: verify and exclude (or modify) events where data field is lower that 1970&lt;BR /&gt;
to exclude use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where  mydate1&amp;gt; strptime("1979-12-31","%Y-%m-%d")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to modify your field you have to choose and apply an algorithm.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 09:51:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236917#M70408</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-11-29T09:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236918#M70409</link>
      <description>&lt;P&gt;Thank you so much !! for your help. just last question &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; is there any way instated of days wise calculation can we use  like as below because the month may have 30 days or 31 or 28, so can we use 1y for year and for months 2m something like ?  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourindex sourcetype="xyz" | eval mydate1=mydate | join id_num [ search index=yourindex sourcetype="abc" | eval mydate2=mydate ] | eval mydate1=strptime(mydate1,"your_format"), mydate2=strptime(mydate2,"your_format") | eval diff=mydate1-mydate2 | where diff&amp;lt; 9m?
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Nov 2016 10:55:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236918#M70409</guid>
      <dc:creator>snehalk</dc:creator>
      <dc:date>2016-11-29T10:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236919#M70410</link>
      <description>&lt;P&gt;Hi snehalk,&lt;BR /&gt;
You don't need to use days or seconds, you can use every relative time, the only rule is to use only one of it: so one year and two months is "14mon".&lt;BR /&gt;
beware to the time unit you are using: "9m" is 9 minutes!&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;BR /&gt;
P.S.: if you like this answer please accept it.&lt;BR /&gt;
Bye.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 11:18:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236919#M70410</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-11-29T11:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236920#M70411</link>
      <description>&lt;P&gt;Thank you so much !! for your help, &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; just last question, can we used standard format instate of day calculation? because the month may contains 30 days or 31 days or some time 28 days , so can we use something like 1y for year and 2 months for months?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourindex sourcetype="xyz" | eval mydate1=mydate | join id_num [ search index=yourindex sourcetype="abc" | eval mydate2=mydate ] | eval mydate1=strptime(mydate1,"your_format"), mydate2=strptime(mydate2,"your_format") | eval diff=mydate1-mydate2 | where diff&amp;lt;1y??
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Nov 2016 12:07:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236920#M70411</guid>
      <dc:creator>snehalk</dc:creator>
      <dc:date>2016-11-29T12:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236921#M70412</link>
      <description>&lt;P&gt;Hi Hi snehalk,&lt;BR /&gt;
I already answered to your last question, but I don't know why my answer isn't in the chain!!!&lt;BR /&gt;
Every way you can use all the time units you want, the only rule is that you have to use only one of them: so one year and two months are 14mon, you cannot use 1y+2mon.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 13:51:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236921#M70412</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-11-29T13:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: search query to get specific date range events from different field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236922#M70413</link>
      <description>&lt;P&gt;Hi Hi snehalk,&lt;BR /&gt;
I don't know why, I cannot find in the chain an answer that I inserted two times!&lt;BR /&gt;
every way you can use every time unit you want the only rule is to use only one of them, so: for one year and two monts, you can use 14 mon, you cannot use 1y+2mon.&lt;BR /&gt;
I hope that this time you can see my answer.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 14:59:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-query-to-get-specific-date-range-events-from-different/m-p/236922#M70413</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-11-29T14:59:01Z</dc:date>
    </item>
  </channel>
</rss>

