<?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 HiddenPostProcess: search and eval confusion in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/HiddenPostProcess-search-and-eval-confusion/m-p/58860#M3099</link>
    <description>&lt;P&gt;I have the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   &amp;lt;module name="HiddenSearch" layoutPanel="panel_row1_col1" autoRun="True"&amp;gt;
        &amp;lt;param name="search"&amp;gt;source="*stats.log" host="*prod*"&amp;lt;/param&amp;gt;
        &amp;lt;param name="earliest"&amp;gt;rt-60m&amp;lt;/param&amp;gt;
        &amp;lt;param name="latest"&amp;gt;rt&amp;lt;/param&amp;gt;

    &amp;lt;module name="HiddenPostProcess" layoutPanel="panel_row1_col1_grp1" group="Look to Book Ratio"&amp;gt;
        &amp;lt;param name="search"&amp;gt;search transactionType="*" | streamstats
            count(eval(transactionType LIKE "%LSRQ")) as look count(eval(transactionType LIKE
            "BOOKRQSS%")) as book | eval lookbook=round(look/book) | rangemap field=lookbook severe=1001-100000 elevated=501-1000 low=0-500&amp;lt;/param&amp;gt;
        &amp;lt;module name="SingleValue"&amp;gt;
            &amp;lt;param name="field"&amp;gt;lookbook&amp;lt;/param&amp;gt;
            &amp;lt;param name="afterLabel"&amp;gt;:1&amp;lt;/param&amp;gt;
            &amp;lt;param name="classField"&amp;gt;range&amp;lt;/param&amp;gt;
        &amp;lt;/module&amp;gt;
    &amp;lt;/module&amp;gt;
     &amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've read several answers here about the idiosyncrasies of using search in HiddenPostProcess modules, but still can't work out why I keep getting "Invalid field" in my SingleValue pane. What have I missed?&lt;/P&gt;

&lt;P&gt;As an aside: the group="Look to Book Ratio" never seems to produce a label on the panel in column 1, but always does for column 2 and column 3. Weird.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 28 Sep 2010 03:07:32 GMT</pubDate>
    <dc:creator>pde</dc:creator>
    <dc:date>2010-09-28T03:07:32Z</dc:date>
    <item>
      <title>HiddenPostProcess: search and eval confusion</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/HiddenPostProcess-search-and-eval-confusion/m-p/58860#M3099</link>
      <description>&lt;P&gt;I have the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   &amp;lt;module name="HiddenSearch" layoutPanel="panel_row1_col1" autoRun="True"&amp;gt;
        &amp;lt;param name="search"&amp;gt;source="*stats.log" host="*prod*"&amp;lt;/param&amp;gt;
        &amp;lt;param name="earliest"&amp;gt;rt-60m&amp;lt;/param&amp;gt;
        &amp;lt;param name="latest"&amp;gt;rt&amp;lt;/param&amp;gt;

    &amp;lt;module name="HiddenPostProcess" layoutPanel="panel_row1_col1_grp1" group="Look to Book Ratio"&amp;gt;
        &amp;lt;param name="search"&amp;gt;search transactionType="*" | streamstats
            count(eval(transactionType LIKE "%LSRQ")) as look count(eval(transactionType LIKE
            "BOOKRQSS%")) as book | eval lookbook=round(look/book) | rangemap field=lookbook severe=1001-100000 elevated=501-1000 low=0-500&amp;lt;/param&amp;gt;
        &amp;lt;module name="SingleValue"&amp;gt;
            &amp;lt;param name="field"&amp;gt;lookbook&amp;lt;/param&amp;gt;
            &amp;lt;param name="afterLabel"&amp;gt;:1&amp;lt;/param&amp;gt;
            &amp;lt;param name="classField"&amp;gt;range&amp;lt;/param&amp;gt;
        &amp;lt;/module&amp;gt;
    &amp;lt;/module&amp;gt;
     &amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've read several answers here about the idiosyncrasies of using search in HiddenPostProcess modules, but still can't work out why I keep getting "Invalid field" in my SingleValue pane. What have I missed?&lt;/P&gt;

&lt;P&gt;As an aside: the group="Look to Book Ratio" never seems to produce a label on the panel in column 1, but always does for column 2 and column 3. Weird.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2010 03:07:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/HiddenPostProcess-search-and-eval-confusion/m-p/58860#M3099</guid>
      <dc:creator>pde</dc:creator>
      <dc:date>2010-09-28T03:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: HiddenPostProcess: search and eval confusion</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/HiddenPostProcess-search-and-eval-confusion/m-p/58861#M3100</link>
      <description>&lt;P&gt;The answer is that in a dashboard or form-search context, Splunk has optimized behavior where it will only extract the fields that it sees in the search language of the main search string. &lt;/P&gt;

&lt;P&gt;2 problems arising out of this. &lt;/P&gt;

&lt;P&gt;1) referring to fields in the postProcess search that are not in the main search.  Splunk didnt extract transactionType in the main search so this wont work. &lt;/P&gt;

&lt;P&gt;2) referring to fields in the SingleValue module that are not in the main search.
The UI can also send a parameter called required_field_list when the search is dispatched, and in most cases the modules are written correctly so that they know to do this.  For example if you have a downstream SimpleResultsTable, with its 'fields' param set,   the table module declares to the framework that it will need those fields extracted, so the framework includes them in the required_field_list.     I think the implementation of SingleValue might overlook this case but i could be wrong. &lt;/P&gt;

&lt;P&gt;Solution: 
easiest solution is to sneak in a fields clause into your main search, and include the '*' in that fields clause so that it doesnt actually do any filtering. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="*stats.log" host="*prod*" | fields transactionType *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Sep 2010 02:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/HiddenPostProcess-search-and-eval-confusion/m-p/58861#M3100</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-09-29T02:33:53Z</dc:date>
    </item>
  </channel>
</rss>

