<?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: Keep most recent _time of multiple fields with non-NULL values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Keep-most-recent-time-of-multiple-fields-with-non-NULL-values/m-p/218675#M64265</link>
    <description>&lt;P&gt;In your last (desired output) table, why does &lt;CODE&gt;Status&lt;/CODE&gt; for &lt;CODE&gt;Field C&lt;/CODE&gt; have a value of &lt;CODE&gt;Incomplete&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;It seems to me that &lt;CODE&gt;Incomplete&lt;/CODE&gt; is determined by a lack of a &lt;CODE&gt;Complete&lt;/CODE&gt; value for the latest time ( &lt;CODE&gt;#1&lt;/CODE&gt; ), right?&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2016 19:35:37 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2016-06-23T19:35:37Z</dc:date>
    <item>
      <title>Keep most recent _time of multiple fields with non-NULL values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Keep-most-recent-time-of-multiple-fields-with-non-NULL-values/m-p/218674#M64264</link>
      <description>&lt;P&gt;I have user-generated data that I am trying to splunk to show whether or not an audit or check has been performed in a certain time range. Example rows look like this ... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time    Field A               Field B              Field C
#1       Complete                                   Complete
#2                                                  Complete     
#3       Complete              Complete       
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Current state: I have a search that creates a table showing complete and incomplete checks: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-24h sourcetype=_json source="AuditData" index=auditindex | stats values(*) as * | appendpipe [ stats count | where count==0] |`AuditFillNull`   | transpose | rename column as "Audit" | rename "row 1" as Status

Audit       Status 
Field A    Complete 
Field B    Incomplete 
Field C    Complete  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above shows the table the search produces if the search time frame covered the #1 event but not #2 or #3.  The fill null macro has an eval + coalesce expression for each field that fills in Incomplete in the place of null values.&lt;/P&gt;

&lt;P&gt;What I would like to show is a table like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Audit       Last Done      Status 
Field A     #1             Complete  
Field B     #3             Incomplete  
Field C     #1             Incomplete 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where the "Last Done" shows the time of the last complete value in the data set. I'm sure there must be a way to accomplish this task but I'm not sure what commands to look at. &lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 19:26:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Keep-most-recent-time-of-multiple-fields-with-non-NULL-values/m-p/218674#M64264</guid>
      <dc:creator>ErikaE</dc:creator>
      <dc:date>2016-06-23T19:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Keep most recent _time of multiple fields with non-NULL values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Keep-most-recent-time-of-multiple-fields-with-non-NULL-values/m-p/218675#M64265</link>
      <description>&lt;P&gt;In your last (desired output) table, why does &lt;CODE&gt;Status&lt;/CODE&gt; for &lt;CODE&gt;Field C&lt;/CODE&gt; have a value of &lt;CODE&gt;Incomplete&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;It seems to me that &lt;CODE&gt;Incomplete&lt;/CODE&gt; is determined by a lack of a &lt;CODE&gt;Complete&lt;/CODE&gt; value for the latest time ( &lt;CODE&gt;#1&lt;/CODE&gt; ), right?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 19:35:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Keep-most-recent-time-of-multiple-fields-with-non-NULL-values/m-p/218675#M64265</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-23T19:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Keep most recent _time of multiple fields with non-NULL values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Keep-most-recent-time-of-multiple-fields-with-non-NULL-values/m-p/218676#M64266</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; earliest=-24h sourcetype=_json source="AuditData" index=auditindex  | table _time FieldA FieldB FieldC | untable _time Audit Value | fillnull value="Incomplete" Value | eval LastDone=if(Value="Complete",_time,null()) | stats latest(LastDone) as "Last Done" latest(Value) as Status by Audit
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jun 2016 19:45:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Keep-most-recent-time-of-multiple-fields-with-non-NULL-values/m-p/218676#M64266</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-23T19:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Keep most recent _time of multiple fields with non-NULL values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Keep-most-recent-time-of-multiple-fields-with-non-NULL-values/m-p/218677#M64267</link>
      <description>&lt;P&gt;In the example : &lt;/P&gt;

&lt;P&gt;The time range of interest (say, last 24 hours) for the set of audits or checks A, B, C returns example event #1 and #2 but not #3. In the old search, that would show A and C as complete and B as incomplete. &lt;/P&gt;

&lt;P&gt;What that doesn't tell the end user is how urgent it is to go and complete Audit B. If it's only been 25 hours that conveys a different level of urgency than if it's been 50.  The example only has 3 audits but in reality there are up to 25 that a single user is responsible for.  The 'old search' compresses many records into a status for the time period at cost of losing the time information. Does that help? &lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 20:15:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Keep-most-recent-time-of-multiple-fields-with-non-NULL-values/m-p/218677#M64267</guid>
      <dc:creator>ErikaE</dc:creator>
      <dc:date>2016-06-23T20:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Keep most recent _time of multiple fields with non-NULL values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Keep-most-recent-time-of-multiple-fields-with-non-NULL-values/m-p/218678#M64268</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;sourcetype=_json source="AuditData" index=auditindex | `AuditFillNull` | table _time * | untable _time Audit Status | eval LastDone=if(Status="Complete",_time,null()) | stats latest(LastDone) as "Last Done" latest(Status) as Status by Audit | eval Last_Done=strftime('Last Done', "%a %H:%M") | table Last_Done Audit Status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That worked great! I had to move the fill null, perhaps because of the way I'm extracting fields the fields simply don't show up if they have a null value. &lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 20:39:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Keep-most-recent-time-of-multiple-fields-with-non-NULL-values/m-p/218678#M64268</guid>
      <dc:creator>ErikaE</dc:creator>
      <dc:date>2016-06-23T20:39:08Z</dc:date>
    </item>
  </channel>
</rss>

