<?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: Why did Splunk 9.0.1 &amp;quot;Fail to parse templatized search for field 'i'&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-did-Splunk-9-0-1-quot-Fail-to-parse-templatized-search-for/m-p/614656#M213613</link>
    <description>&lt;P&gt;Read&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Foreach#foreach" target="_blank" rel="noopener"&gt;foreach&lt;/A&gt;&amp;nbsp;again. &amp;nbsp;It turns out that &amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt; iterator requires mode=multivalue (a new flag in Splunk 9). &amp;nbsp;A proper test construct should be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval i = mvrange(0,3)
| foreach i mode=multivalue
    [eval showme = mvappend(showme, "equals " . &amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;)]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV class=""&gt;i&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;showme&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV class=""&gt;0&lt;/DIV&gt;&lt;DIV class=""&gt;1&lt;/DIV&gt;&lt;DIV class=""&gt;2&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;equals 0&lt;/DIV&gt;&lt;DIV class=""&gt;equals 1&lt;/DIV&gt;&lt;DIV class=""&gt;equals 2&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Quote is irrelevant in simple field names.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Sep 2022 04:33:14 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2022-09-27T04:33:14Z</dc:date>
    <item>
      <title>Why did Splunk 9.0.1 "Fail to parse templatized search for field 'i'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-did-Splunk-9-0-1-quot-Fail-to-parse-templatized-search-for/m-p/614619#M213606</link>
      <description>&lt;P&gt;I'm trying to use the Splunk 9 addition in foreach iteration with ITEM, but it always returns "Failed to parse templatized search for field 'i'" on my server, which runs 9.0.1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| makeresults
| eval i = mvrange(0,3)
| foreach i
    [eval showme = &amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I previously used &amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt; on a laptop Splunk 9 and it didn't have this error.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 21:06:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-did-Splunk-9-0-1-quot-Fail-to-parse-templatized-search-for/m-p/614619#M213606</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-09-26T21:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why did Splunk 9.0.1 "Fail to parse templatized search for field 'i'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-did-Splunk-9-0-1-quot-Fail-to-parse-templatized-search-for/m-p/614636#M213609</link>
      <description>&lt;P&gt;Not sure as I don't have Splunk 9, but that error typically occurs when you don't wrap the right hand side of eval in single quotes.&lt;/P&gt;&lt;P&gt;Just thinking that the value of &amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt; in this case is a numeric 0 to 3, so normally if those numbers were fields, you'd have to wrap them in single quote, e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval 0=1
| eval x='0'*2&lt;/LI-CODE&gt;&lt;P&gt;No idea if that is relevant here though&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 00:55:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-did-Splunk-9-0-1-quot-Fail-to-parse-templatized-search-for/m-p/614636#M213609</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-27T00:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why did Splunk 9.0.1 "Fail to parse templatized search for field 'i'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-did-Splunk-9-0-1-quot-Fail-to-parse-templatized-search-for/m-p/614652#M213610</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;! &amp;nbsp;Funny enough, change the test to&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval i = mvrange(0,3)
| foreach i
    [eval showme = '&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;']&lt;/LI-CODE&gt;&lt;P&gt;(or its mvappend equivalent) does suppress the error, even though it doesn't assign any value to showme - which was my real problem. &amp;nbsp;In fact, my initial code - for the real problem, used single quotes. &amp;nbsp;No error but no value, hence the experimentation. &amp;nbsp;Regardless, the subject question is answered.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 04:07:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-did-Splunk-9-0-1-quot-Fail-to-parse-templatized-search-for/m-p/614652#M213610</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-09-27T04:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why did Splunk 9.0.1 "Fail to parse templatized search for field 'i'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-did-Splunk-9-0-1-quot-Fail-to-parse-templatized-search-for/m-p/614656#M213613</link>
      <description>&lt;P&gt;Read&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Foreach#foreach" target="_blank" rel="noopener"&gt;foreach&lt;/A&gt;&amp;nbsp;again. &amp;nbsp;It turns out that &amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt; iterator requires mode=multivalue (a new flag in Splunk 9). &amp;nbsp;A proper test construct should be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval i = mvrange(0,3)
| foreach i mode=multivalue
    [eval showme = mvappend(showme, "equals " . &amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;)]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV class=""&gt;i&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;showme&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV class=""&gt;0&lt;/DIV&gt;&lt;DIV class=""&gt;1&lt;/DIV&gt;&lt;DIV class=""&gt;2&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;equals 0&lt;/DIV&gt;&lt;DIV class=""&gt;equals 1&lt;/DIV&gt;&lt;DIV class=""&gt;equals 2&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Quote is irrelevant in simple field names.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 04:33:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-did-Splunk-9-0-1-quot-Fail-to-parse-templatized-search-for/m-p/614656#M213613</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-09-27T04:33:14Z</dc:date>
    </item>
  </channel>
</rss>

