<?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: Is there a way to  eval 'job.resultCount' in a postprocess search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-eval-job-resultCount-in-a-postprocess-search/m-p/263542#M79110</link>
    <description>&lt;P&gt;I don't think the postprocess search is technically a job, so there won't be any individual job properties.&lt;/P&gt;

&lt;P&gt;As a workaround, you could hack yourself a hidden field with &lt;CODE&gt;| eventstats count as _resultCount&lt;/CODE&gt; and use &lt;CODE&gt;$row._resultCount$&lt;/CODE&gt; in a &lt;CODE&gt;&amp;lt;finalized&amp;gt;&lt;/CODE&gt; element (untested).&lt;/P&gt;</description>
    <pubDate>Tue, 29 Mar 2016 16:36:29 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2016-03-29T16:36:29Z</dc:date>
    <item>
      <title>Is there a way to  eval 'job.resultCount' in a postprocess search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-eval-job-resultCount-in-a-postprocess-search/m-p/263541#M79109</link>
      <description>&lt;P&gt;We recently upgraded to 6.3 and I have been toying with using eval and search event handlers. In one of my dashboards I run a global base search and then post-process in a bunch of panels to focus in on different data. However, when I attach the following search event handler&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search id="s_base"&amp;gt;
  &amp;lt;query&amp;gt;index=foo_na ....&amp;lt;/query&amp;gt;
&amp;lt;/search&amp;gt;
.
.
.
&amp;lt;search id="s_bar" base="s_base"&amp;gt;
    &amp;lt;query&amp;gt; | where baz=="foobar" | timechart count by baz &amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;eval token="t_test_token"&amp;gt;'job.resultCount'&amp;lt;/eval&amp;gt;
    &amp;lt;/done&amp;gt;
&amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It seems to be evaluating to the job.resultCount value of the base search, not the post process search. Is this the expected behavior, or is there another job property that relates to the postprocessed count? Looking through the EventHandlerReference and ViewsearchjobpropertieswiththeJobInspector doc pages, I don't see anything that explicitly addresses how this should behave.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 14:32:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-eval-job-resultCount-in-a-postprocess-search/m-p/263541#M79109</guid>
      <dc:creator>tasqn</dc:creator>
      <dc:date>2016-03-29T14:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to  eval 'job.resultCount' in a postprocess search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-eval-job-resultCount-in-a-postprocess-search/m-p/263542#M79110</link>
      <description>&lt;P&gt;I don't think the postprocess search is technically a job, so there won't be any individual job properties.&lt;/P&gt;

&lt;P&gt;As a workaround, you could hack yourself a hidden field with &lt;CODE&gt;| eventstats count as _resultCount&lt;/CODE&gt; and use &lt;CODE&gt;$row._resultCount$&lt;/CODE&gt; in a &lt;CODE&gt;&amp;lt;finalized&amp;gt;&lt;/CODE&gt; element (untested).&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 16:36:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-eval-job-resultCount-in-a-postprocess-search/m-p/263542#M79110</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-03-29T16:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to  eval 'job.resultCount' in a postprocess search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-eval-job-resultCount-in-a-postprocess-search/m-p/263543#M79111</link>
      <description>&lt;P&gt;Thanks, I'll give that a shot. I also worked around it a bit when I found out that the &lt;CODE&gt;&amp;lt;preview&amp;gt;&lt;/CODE&gt; handler doesn't trigger if there are no events in the postprocess. So, I can do conditional &lt;CODE&gt;&amp;lt;condition match=[eval expr]&amp;gt;&lt;/CODE&gt; in that tag, then inside the &lt;CODE&gt;&amp;lt;done&amp;gt;&lt;/CODE&gt; tag I just handle the case of no results if the tokens are null.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 16:59:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-eval-job-resultCount-in-a-postprocess-search/m-p/263543#M79111</guid>
      <dc:creator>tasqn</dc:creator>
      <dc:date>2016-03-29T16:59:16Z</dc:date>
    </item>
  </channel>
</rss>

