<?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 Why does the query only work in eval and not fieldformat? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-does-the-query-only-work-in-eval-and-not-fieldformat/m-p/343752#M101820</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have this query.  If I change fieldformat to eval the query works but if it is left as fieldformat the query returns no results.  First time I'm trying to use fieldformat so I don't quite understand what I'm missing.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-24h index=wholesale_app buildTarget=* product=* CustomAnalytic Properties.index=17 OR Properties.index=19 OR Properties.index=21 OR Properties.index=23 OR (Properties.index=&amp;gt;25 AND Properties.index&amp;lt;=32) buildTarget=* product=* |rename Properties.index as pindex|fieldformat pindextype=case(pindex == "17", "CVR Event Selected", pindex == "19", "CVR Fetch Events",pindex == "21", "CVR Event View Ended", pindex == "23", "CVR Play Pressed",pindex == "25", "CVR Pause Pressed", pindex == "26", "CVR Landscape Orientation",pindex == "27", "CVR Portrait Orientation", pindex == "28", "CVR Jump Forward", pindex == "29", "CVR Jump Back", pindex == "30", "CVR Video Session Started", pindex == "31", "CVR Video Error", pindex == "32", "CVR Range Set")|stats count by pindextype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Feb 2018 21:59:01 GMT</pubDate>
    <dc:creator>dbcase</dc:creator>
    <dc:date>2018-02-01T21:59:01Z</dc:date>
    <item>
      <title>Why does the query only work in eval and not fieldformat?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-the-query-only-work-in-eval-and-not-fieldformat/m-p/343752#M101820</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have this query.  If I change fieldformat to eval the query works but if it is left as fieldformat the query returns no results.  First time I'm trying to use fieldformat so I don't quite understand what I'm missing.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-24h index=wholesale_app buildTarget=* product=* CustomAnalytic Properties.index=17 OR Properties.index=19 OR Properties.index=21 OR Properties.index=23 OR (Properties.index=&amp;gt;25 AND Properties.index&amp;lt;=32) buildTarget=* product=* |rename Properties.index as pindex|fieldformat pindextype=case(pindex == "17", "CVR Event Selected", pindex == "19", "CVR Fetch Events",pindex == "21", "CVR Event View Ended", pindex == "23", "CVR Play Pressed",pindex == "25", "CVR Pause Pressed", pindex == "26", "CVR Landscape Orientation",pindex == "27", "CVR Portrait Orientation", pindex == "28", "CVR Jump Forward", pindex == "29", "CVR Jump Back", pindex == "30", "CVR Video Session Started", pindex == "31", "CVR Video Error", pindex == "32", "CVR Range Set")|stats count by pindextype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Feb 2018 21:59:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-the-query-only-work-in-eval-and-not-fieldformat/m-p/343752#M101820</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-02-01T21:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the query only work in eval and not fieldformat?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-the-query-only-work-in-eval-and-not-fieldformat/m-p/343753#M101821</link>
      <description>&lt;P&gt;The function &lt;CODE&gt;fieldformat&lt;/CODE&gt; is used to change the format of "existing" field without changing underlying value. Here the field pindextype doesn't exist hence can't be used with &lt;CODE&gt;fieldformat&lt;/CODE&gt; command. You've to either use eval itself OR use fieldformat with existing field "pindex"&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 22:40:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-the-query-only-work-in-eval-and-not-fieldformat/m-p/343753#M101821</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-02-01T22:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the query only work in eval and not fieldformat?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-the-query-only-work-in-eval-and-not-fieldformat/m-p/343754#M101822</link>
      <description>&lt;P&gt;Of course, your last stats command would change too if you plan to use existing field pindex. &lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 22:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-the-query-only-work-in-eval-and-not-fieldformat/m-p/343754#M101822</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-02-01T22:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the query only work in eval and not fieldformat?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-the-query-only-work-in-eval-and-not-fieldformat/m-p/343755#M101823</link>
      <description>&lt;P&gt;Ahhhhh thats what I missed ... EXISTING field, now it makes sense&lt;/P&gt;

&lt;P&gt;Thanks Somesoni2!  (again)&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 22:47:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-the-query-only-work-in-eval-and-not-fieldformat/m-p/343755#M101823</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-02-01T22:47:40Z</dc:date>
    </item>
  </channel>
</rss>

