<?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 How to separate column for different date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-column-for-different-date/m-p/324143#M166201</link>
    <description>&lt;P&gt;Hi everyone.&lt;BR /&gt;
I have this current search result below and I want to have another column for different dates as a desired result. Anyone knows how can I achieve this?&lt;/P&gt;

&lt;P&gt;current result:&lt;BR /&gt;
Job           Description      Time&lt;BR /&gt;
DC_job  some desc      1/09/2017 0:02&lt;BR /&gt;
SS_job  another dsc    1/09/2017 0:13&lt;BR /&gt;
DC_job  some desc        2/09/2017 0:02&lt;BR /&gt;
SS_job  another dsc    2/09/2017 1:28&lt;BR /&gt;
DC_job  some desc      3/09/2017 1:34&lt;BR /&gt;
SS_job  another dsc    3/09/2017 1:42&lt;/P&gt;

&lt;P&gt;desired result:&lt;BR /&gt;
Job           Description      Time                          yday                         otherday&lt;BR /&gt;
DC_job  some desc      1/09/2017 0:02        2/09/2017 0:02      3/09/2017 1:34&lt;BR /&gt;
SS_job  another dsc    1/09/2017 0:13        2/09/2017 1:28      3/09/2017 1:42&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 15:39:19 GMT</pubDate>
    <dc:creator>headstrong25</dc:creator>
    <dc:date>2020-09-29T15:39:19Z</dc:date>
    <item>
      <title>How to separate column for different date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-column-for-different-date/m-p/324143#M166201</link>
      <description>&lt;P&gt;Hi everyone.&lt;BR /&gt;
I have this current search result below and I want to have another column for different dates as a desired result. Anyone knows how can I achieve this?&lt;/P&gt;

&lt;P&gt;current result:&lt;BR /&gt;
Job           Description      Time&lt;BR /&gt;
DC_job  some desc      1/09/2017 0:02&lt;BR /&gt;
SS_job  another dsc    1/09/2017 0:13&lt;BR /&gt;
DC_job  some desc        2/09/2017 0:02&lt;BR /&gt;
SS_job  another dsc    2/09/2017 1:28&lt;BR /&gt;
DC_job  some desc      3/09/2017 1:34&lt;BR /&gt;
SS_job  another dsc    3/09/2017 1:42&lt;/P&gt;

&lt;P&gt;desired result:&lt;BR /&gt;
Job           Description      Time                          yday                         otherday&lt;BR /&gt;
DC_job  some desc      1/09/2017 0:02        2/09/2017 0:02      3/09/2017 1:34&lt;BR /&gt;
SS_job  another dsc    1/09/2017 0:13        2/09/2017 1:28      3/09/2017 1:42&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:39:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-column-for-different-date/m-p/324143#M166201</guid>
      <dc:creator>headstrong25</dc:creator>
      <dc:date>2020-09-29T15:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate column for different date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-column-for-different-date/m-p/324144#M166202</link>
      <description>&lt;P&gt;Hi headstrong25,&lt;BR /&gt;
try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search earliest=@d latest=now
| eval _time=strftime(_time,"%d/%m/%Y %H.%M.%S")
| stats values(Description) AS Description latest(_time) AS Time by Job
| append [ search 
     your_search earliest=-1d@d latest=@d
     | eval _time=strftime(_time,"%d/%m/%Y %H.%M.%S") 
     | stats latest(_time) AS yesterday by Job
     ]
| append [ search 
     your_search latest=-1d@d
     | eval _time=strftime(_time,"%d/%m/%Y %H.%M.%S")
     | stats latest(_time) AS otherdays by Job
     ]
| stats values(Description) AS Description values(_time) AS Time values(_time) AS yesterday  values(_time) AS otherdays by Job
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;using a time period greater than 2 days.&lt;BR /&gt;
If you have more than one date for each job I took the last, to take the first use earlieste instead latest in statsa command.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 11:03:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-column-for-different-date/m-p/324144#M166202</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-09-06T11:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate column for different date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-column-for-different-date/m-p/324145#M166203</link>
      <description>&lt;P&gt;Thanks cusello. This works for me.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 06:12:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-column-for-different-date/m-p/324145#M166203</guid>
      <dc:creator>headstrong25</dc:creator>
      <dc:date>2017-09-07T06:12:07Z</dc:date>
    </item>
  </channel>
</rss>

