<?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: Add latest field with a filter to table that also displays unfiltered rows in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Add-latest-field-with-a-filter-to-table-that-also-displays/m-p/702083#M238091</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|stats latest(result), latest(eval(if(result="failed",_time,null()))) as last_failed, latest(_time) as last_checked, latest(runtime) as lastRuntime, avg(seconds) as averageRuntime by test&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 16 Oct 2024 16:07:53 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-10-16T16:07:53Z</dc:date>
    <item>
      <title>Add latest field with a filter to table that also displays unfiltered rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-latest-field-with-a-filter-to-table-that-also-displays/m-p/702081#M238089</link>
      <description>&lt;P&gt;Hi All, newbie here - Sorry if my subject is poorly worded, I'm a little confused!&lt;/P&gt;&lt;P&gt;I'm trying to add a field to the table below that will show how long it's been since the last test failed.&amp;nbsp; This table also contains a column that shows the last time a test ran (pass or fail). Here's a picture.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="splunkQuestion.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/33120i689C7DE9A10A322E/image-size/large?v=v2&amp;amp;px=999" role="button" title="splunkQuestion.png" alt="splunkQuestion.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here's my current search:&lt;/P&gt;&lt;P&gt;index="redacted" | rex field=runtime "^(?&amp;lt;seconds&amp;gt;\w*.\w*)" |stats latest(result), latest(_time) as last_checked, latest(runtime) as lastRuntime, avg(seconds) as averageRuntime by test&lt;BR /&gt;| eval averageRuntime=round(averageRuntime,0)&lt;BR /&gt;| strcat averageRuntime f2 " seconds." field3 averageRuntime&lt;BR /&gt;| `timesince(last_checked,last_checked)`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas or tips are greatly appreciated. Thanks in Advance.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 15:36:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-latest-field-with-a-filter-to-table-that-also-displays/m-p/702081#M238089</guid>
      <dc:creator>mrminks</dc:creator>
      <dc:date>2024-10-16T15:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Add latest field with a filter to table that also displays unfiltered rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-latest-field-with-a-filter-to-table-that-also-displays/m-p/702083#M238091</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|stats latest(result), latest(eval(if(result="failed",_time,null()))) as last_failed, latest(_time) as last_checked, latest(runtime) as lastRuntime, avg(seconds) as averageRuntime by test&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 16 Oct 2024 16:07:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-latest-field-with-a-filter-to-table-that-also-displays/m-p/702083#M238091</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-10-16T16:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add latest field with a filter to table that also displays unfiltered rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-latest-field-with-a-filter-to-table-that-also-displays/m-p/702086#M238092</link>
      <description>&lt;P&gt;Wow this is exactly what I wanted!&amp;nbsp; I spent hours trying to figure this out.&amp;nbsp; Thanks again for the clear instructions&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 16:33:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-latest-field-with-a-filter-to-table-that-also-displays/m-p/702086#M238092</guid>
      <dc:creator>mrminks</dc:creator>
      <dc:date>2024-10-16T16:33:21Z</dc:date>
    </item>
  </channel>
</rss>

