<?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 do you retrieve date from the following string using regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399289#M115795</link>
    <description>&lt;P&gt;@ramesh12345 don't forget to upvote and accept the answer. This thread has been long and other questions arose. Upvote the useful comments please&lt;/P&gt;</description>
    <pubDate>Thu, 28 Feb 2019 14:39:54 GMT</pubDate>
    <dc:creator>tiagofbmm</dc:creator>
    <dc:date>2019-02-28T14:39:54Z</dc:date>
    <item>
      <title>How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399270#M115776</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Test-20190212-0912 from this string. I want to retrieve date like this 2019-02-12&lt;/P&gt;

&lt;P&gt;How do I write this in regex?&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6571iB9EDB1063E29CC37/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 10:33:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399270#M115776</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-02-27T10:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399271#M115777</link>
      <description>&lt;P&gt;Use a rex first and to split the parts of it and then concatenate it to your new field&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval time="Test-20190212-0912" | rex field=time "Test-(?&amp;lt;year&amp;gt;\d{4})(?&amp;lt;month&amp;gt;\d{2})(?&amp;lt;day&amp;gt;\d{2})"
| eval time=year+"-"+month+"-"+day
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Feb 2019 10:38:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399271#M115777</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2019-02-27T10:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399272#M115778</link>
      <description>&lt;P&gt;Hi @ramesh12345&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval str="Test-20190212-0912" 
| rex field=str "-(?P&amp;lt;year&amp;gt;\d{4})(?P&amp;lt;month&amp;gt;\d{2})(?P&amp;lt;date&amp;gt;\d{2})" 
| eval result= year."-".month."-".date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Feb 2019 10:39:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399272#M115778</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-02-27T10:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399273#M115779</link>
      <description>&lt;P&gt;i have other small problem&lt;/P&gt;

&lt;P&gt;index="os" sourcetype="Service" status=* (Group="Data/Config" OR Group="Secure") AND (Section="Site Problem" OR Section="Local health") AND (Component="connectivity" OR Component="health")|dedup _time,CaseNumber|where Created_ON=Updated_ON| eval days = (Now() - _time) /86400| eval days_ago = case(days 60, "2-3months",days&amp;lt; 60 AND days &amp;gt; 30, "1-2 months",days&amp;lt; 28 AND days &amp;gt; 14, "2-4 weeks",days&amp;lt; 14 AND days &amp;gt; 7, "1-2 weeks",days&amp;lt; 7 AND days &amp;gt; 5, "5-7days", days &amp;lt; 5 AND days &amp;gt; 2, "2-5 days", days &amp;lt; 2 AND days &amp;gt; 1, "2 Days", days &amp;lt; 1, "Less than 1 Day")| chart count by days_ago,Group|sort days_ago&lt;/P&gt;

&lt;P&gt;most cases have both (Group="Data/Config" OR Group="Secure").&lt;BR /&gt;
initially (Group is "Data/Config") then after some time it change to (Group="Secure").when i count by group,it is showing initial Group name for that case.it is not showing to current group.&lt;/P&gt;

&lt;P&gt;i want to display count by group with latest group name(i.e case that have latest group that comes under particular group not previous group)&lt;/P&gt;

&lt;P&gt;How to do this?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:21:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399273#M115779</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2020-09-29T23:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399274#M115780</link>
      <description>&lt;P&gt;Just transform the old group to the new one and keep doing what you were doing&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Group=if(Group="Data/Config", "Secure", Group)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Don't forget to accept answers and upvote  comments that actually helped you solve your problems&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 10:52:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399274#M115780</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2019-02-27T10:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399275#M115781</link>
      <description>&lt;P&gt;index="os" sourcetype="Service" status=* (Group="Data/Config" OR Group="Secure") AND (Section="Site Problem" OR Section="Local health") AND (Component="connectivity" OR Component="health")|dedup _time,CaseNumber|where Created_ON=Updated_ON|eval Group=if(Group="Data/Config", "Secure", Group)|eval days = (Now() - _time) /86400| eval days_ago = case(days 60, "2-3months",days&amp;lt; 60 AND days &amp;gt; 30, "1-2 months",days&amp;lt; 28 AND days &amp;gt; 14, "2-4 weeks",days&amp;lt; 14 AND days &amp;gt; 7, "1-2 weeks",days&amp;lt; 7 AND days &amp;gt; 5, "5-7days", days &amp;lt; 5 AND days &amp;gt; 2, "2-5 days", days &amp;lt; 2 AND days &amp;gt; 1, "2 Days", days &amp;lt; 1, "Less than 1 Day")| chart count by days_ago,Group|sort days_ago&lt;/P&gt;

&lt;P&gt;when i add your line to my query it is not displaying any data&lt;/P&gt;

&lt;P&gt;i am finding the created case with the help of Created_ON=Updated_ON.at that time Group name is one,after that it is changing.so when i execute the query it is searching the condition Created_ON=Updated_ON at that time which group is there,it is displaying that group.&lt;/P&gt;

&lt;P&gt;so i need to find the data with in particular date created cases with present Group.&lt;/P&gt;

&lt;P&gt;How to do this?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:21:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399275#M115781</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2020-09-29T23:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399276#M115782</link>
      <description>&lt;P&gt;&lt;CODE&gt;eval days_ago = case(days 60, "2-3months",days&amp;lt; 60 AND days &amp;gt; 30, "1-2 months",days&amp;lt; 28 AND days &amp;gt; 14, "2-4 weeks",days&amp;lt; 14 AND days &amp;gt; 7, "1-2 weeks",days&amp;lt; 7 AND days &amp;gt; 5, "5-7days", days &amp;lt; 5 AND days &amp;gt; 2, "2-5 days", days &amp;lt; 2 AND days &amp;gt; 1, "2 Days", days &amp;lt; 1, "Less than 1 Day")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;There is a comparison missing on the first clause. Can you confirm first that the result of &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="os" sourcetype="Service" status=* (Group="Data/Config" OR Group="Secure") AND (Section="Site Problem" OR Section="Local health") AND (Component="connectivity" OR Component="health") 
| dedup _time,CaseNumber 
| where Created_ON=Updated_ON 
| eval NewGroup=if(Group="Data/Config", "Secure", Group) 
| eval days = (Now() - _time) /86400 
| eval days_ago = case(days 60, "2-3months",days&amp;lt; 60 AND days &amp;gt; 30, "1-2 months",days&amp;lt; 28 AND days &amp;gt; 14, "2-4 weeks",days&amp;lt; 14 AND days &amp;gt; 7, "1-2 weeks",days&amp;lt; 7 AND days &amp;gt; 5, "5-7days", days &amp;lt; 5 AND days &amp;gt; 2, "2-5 days", days &amp;lt; 2 AND days &amp;gt; 1, "2 Days", days &amp;lt; 1, "Less than 1 Day") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Has the NewGroup lilke you expect it to be? &lt;/P&gt;

&lt;P&gt;And only then apply &lt;CODE&gt;| chart count by days_ago, NewGroup|sort days_ago&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 14:24:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399276#M115782</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2019-02-27T14:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399277#M115783</link>
      <description>&lt;P&gt;For NewGroup also it is displaying same two Groups,when i add this | chart count by days_ago, NewGroup|sort days_ago to the query it is not displaying any data&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:30:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399277#M115783</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2020-09-29T23:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399278#M115784</link>
      <description>&lt;P&gt;From my point of you Created_ON=Updated_ON is the problem,because this statement is used to find the created cases count.when it is checking the condition that time Group it is displaying.&lt;/P&gt;

&lt;P&gt;Initially&lt;BR /&gt;
Ex:Created_ON   2019-02-27 12:00:00 &lt;BR /&gt;
      Updated_ON 2019-02-27 12:00:00 &lt;BR /&gt;
      Group:Data/Config&lt;/P&gt;

&lt;P&gt;Next Updated_ON:2019-02-27 14:30:00 &lt;BR /&gt;
          Group:Secure&lt;BR /&gt;
But it is displaying First Group only.i want current group&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:30:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399278#M115784</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2020-09-29T23:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399279#M115785</link>
      <description>&lt;P&gt;Tell me if this is what your data looks like:&lt;/P&gt;

&lt;P&gt;Created, Updated, CaseNumber, Group&lt;BR /&gt;
2019-02-27 12:00:00, 2019-02-27 12:00:00, 1, Data/Config&lt;BR /&gt;
2019-02-27 14:30:00 , :2019-02-27 14:30:00 , 2, Secure&lt;/P&gt;

&lt;P&gt;If this is your format, since you are deduping the Case_Number, I don't see how can you get, for the same CaseNumber, a change in the Group...&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 15:14:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399279#M115785</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2019-02-27T15:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399280#M115786</link>
      <description>&lt;P&gt;Yes the data is like that only.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 10:03:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399280#M115786</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-02-28T10:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399281#M115787</link>
      <description>&lt;P&gt;Can you please send me the final query.i just deduped the _time.removed CaseNumber as well.but it is showing only one group.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 10:40:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399281#M115787</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-02-28T10:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399282#M115788</link>
      <description>&lt;P&gt;Final query?&lt;/P&gt;

&lt;P&gt;Is that it?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index="os" sourcetype="Service" status=* (Group="Data/Config" OR Group="Secure") AND (Section="Site Problem" OR Section="Local health") AND (Component="connectivity" OR Component="health") &lt;BR /&gt;
 | dedup _time&lt;BR /&gt;
 | where Created_ON=Updated_ON &lt;BR /&gt;
 | eval NewGroup=if(Group="Data/Config", "Secure", Group) &lt;BR /&gt;
 | eval days = (Now() - _time) /86400 &lt;BR /&gt;
 | eval days_ago = case(days&amp;gt;60, "2-3months",days&amp;lt; 60 AND days &amp;gt; 30, "1-2 months",days&amp;lt; 28 AND days &amp;gt; 14, "2-4 weeks",days&amp;lt; 14 AND days &amp;gt; 7, "1-2 weeks",days&amp;lt; 7 AND days &amp;gt; 5, "5-7days", days &amp;lt; 5 AND days &amp;gt; 2, "2-5 days", days &amp;lt; 2 AND days &amp;gt; 1, "2 Days", days &amp;lt; 1, "Less than 1 Day") &lt;BR /&gt;
| chart count by days_ago,NewGroup&lt;BR /&gt;
|sort days_ago&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 10:42:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399282#M115788</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2019-02-28T10:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399283#M115789</link>
      <description>&lt;P&gt;Still it is displaying same One group.not displaying with latest Group.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 11:26:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399283#M115789</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-02-28T11:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399284#M115790</link>
      <description>&lt;P&gt;Run this search, it's a dummy one, you can run it everywhere, and tell me if this is the scenario you are seeing before chart:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| makeresults &lt;BR /&gt;
| eval Created_ON="2019-02-27 12:00:00", Updated_ON="2019-02-27 12:00:00", CaseNumber=1, Group="Data/Config", Section="Site Problem",Component="health" &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=2, Group="Data/Config" , Section="Site Problem",Component="health" ] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=3, Group="Data/Config", Section="Site Problem",Component="health"] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=4, Group="Data/Config", Section="Site Problem",Component="health"] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=2, Group="Secure", Section="Site Problem",Component="health"] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=6, Group="Secure", Section="Site Problem",Component="health"] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=4, Group="Secure", Section="Site Problem",Component="health"] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=77, Group="Secure", Section="Site Problem",Component="health"] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=22, Group="Secure", Section="Site Problem",Component="health"] &lt;BR /&gt;
| where Created_ON=Updated_ON &lt;BR /&gt;
| eval NewGroup=if(Group="Data/Config", "Secure", Group) &lt;BR /&gt;
| eval days = (Now() - _time) /86400 &lt;BR /&gt;
| eval days_ago = case(days&amp;gt;60, "2-3months",days&amp;lt; 60 AND days &amp;gt; 30, "1-2 months",days&amp;lt; 28 AND days &amp;gt; 14, "2-4 weeks",days&amp;lt; 14 AND days &amp;gt; 7, "1-2 weeks",days&amp;lt; 7 AND days &amp;gt; 5, "5-7days", days &amp;lt; 5 AND days &amp;gt; 2, "2-5 days", days &amp;lt; 2 AND days &amp;gt; 1, "2 Days", days &amp;lt; 1, "Less than 1 Day")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 11:43:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399284#M115790</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2019-02-28T11:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399285#M115791</link>
      <description>&lt;P&gt;Exactly i want to display the latest group as i added image you can see.&lt;/P&gt;

&lt;P&gt;If it i s one group one color other one other color&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 12:25:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399285#M115791</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-02-28T12:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399286#M115792</link>
      <description>&lt;P&gt;I don't see the point of | where Created_ON=Updated_ON. If they are tickets, this is probably true only at creation time, so I took it off on the search. This will give you the latest value of Group per CaseNumber. You mentioned it starts as Data/Config but then changed to Secure, so while a case number has only Data/Config, it will remain like that. If there is both Data/COnfig and later Secure for a case number, then it will keep Secure.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| makeresults &lt;BR /&gt;
| eval Created_ON="2019-02-27 12:00:00", Updated_ON="2019-02-27 12:00:00", CaseNumber=1, Group="Data/Config", Section="Site Problem",Component="health", _time=Updated_ON &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=2, Group="Data/Config" , Section="Site Problem",Component="health", _time=Updated_ON ] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=3, Group="Data/Config", Section="Site Problem",Component="health", _time=Updated_ON] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=4, Group="Data/Config", Section="Site Problem",Component="health", _time=Updated_ON] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 15:30:00", CaseNumber=2, Group="Secure", Section="Site Problem",Component="health", _time=Updated_ON] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=6, Group="Secure", Section="Site Problem",Component="health", _time=Updated_ON] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=4, Group="Secure", Section="Site Problem",Component="health", _time=Updated_ON] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=77, Group="Secure", Section="Site Problem",Component="health", _time=Updated_ON] &lt;BR /&gt;
| append &lt;BR /&gt;
    [| makeresults &lt;BR /&gt;
    | eval Created_ON="2019-02-27 14:30:00", Updated_ON="2019-02-27 14:30:00", CaseNumber=22, Group="Secure", Section="Site Problem",Component="health", _time=Updated_ON] &lt;BR /&gt;
| eval NewGroup=if(Group="Data/Config", "Secure", Group) &lt;BR /&gt;
| eval days = (now() - strptime(_time,"%Y-%m-%d %H:%M:%S"))/86400 &lt;BR /&gt;
| eval days_ago = case(days&amp;gt;60, "2-3months",days&amp;lt; 60 AND days &amp;gt; 30, "1-2 months",days&amp;lt; 28 AND days &amp;gt; 14, "2-4 weeks",days&amp;lt; 14 AND days &amp;gt; 7, "1-2 weeks",days&amp;lt; 7 AND days &amp;gt; 5, "5-7days", days &amp;lt; 5 AND days &amp;gt; 2, "2-5 days", days &amp;lt; 2 AND days &amp;gt; 1, "2 Days", days &amp;lt; 1, "Less than 1 Day") &lt;BR /&gt;
| eventstats last(Group) as LatestGroup by CaseNumber &lt;BR /&gt;
| chart count by days_ago,LatestGroup &lt;BR /&gt;
| sort days_ago&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399286#M115792</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2020-09-29T23:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399287#M115793</link>
      <description>&lt;P&gt;Could you please send me the final query.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 14:14:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399287#M115793</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-02-28T14:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399288#M115794</link>
      <description>&lt;P&gt;index="os" sourcetype="Service" status=* (Group="Data/Config" OR Group="Secure") AND (Section="Site Problem" OR Section="Local health") AND (Component="connectivity" OR Component="health") &lt;BR /&gt;
| eval NewGroup=if(Group="Data/Config", "Secure", Group) | eval days = (now() - strptime(_time,"%Y-%m-%d %H:%M:%S"))/86400 | eval days_ago = case(days&amp;gt;60, "2-3months",days&amp;lt; 60 AND days &amp;gt; 30, "1-2 months",days&amp;lt; 28 AND days &amp;gt; 14, "2-4 weeks",days&amp;lt; 14 AND days &amp;gt; 7, "1-2 weeks",days&amp;lt; 7 AND days &amp;gt; 5, "5-7days", days &amp;lt; 5 AND days &amp;gt; 2, "2-5 days", days &amp;lt; 2 AND days &amp;gt; 1, "2 Days", days &amp;lt; 1, "Less than 1 Day") | eventstats last(Group) as LatestGroup by CaseNumber | chart count by days_ago,LatestGroup | sort days_ago&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:31:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399288#M115794</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2020-09-29T23:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve date from the following string using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399289#M115795</link>
      <description>&lt;P&gt;@ramesh12345 don't forget to upvote and accept the answer. This thread has been long and other questions arose. Upvote the useful comments please&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 14:39:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-retrieve-date-from-the-following-string-using-regex/m-p/399289#M115795</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2019-02-28T14:39:54Z</dc:date>
    </item>
  </channel>
</rss>

