<?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: Validation Expression is not working in my macro. in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Validation-Expression-is-not-working-in-my-macro/m-p/447992#M3978</link>
    <description>&lt;P&gt;Although I was checking the operation, it seems that the following &lt;CODE&gt;Validation Expression&lt;/CODE&gt; does not apply to the value of field passed as an argument.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;like($arg$, "OK")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;In the above example, the field &lt;CODE&gt;flag&lt;/CODE&gt; is passed, but it seems that &lt;CODE&gt;Validation Expression&lt;/CODE&gt; doesn't judge value of &lt;CODE&gt;flag&lt;/CODE&gt;, but the &lt;CODE&gt;flag&lt;/CODE&gt; as string.&lt;/P&gt;

&lt;P&gt;Is this a specification...?&lt;/P&gt;</description>
    <pubDate>Tue, 19 Mar 2019 01:00:34 GMT</pubDate>
    <dc:creator>yutaka1005</dc:creator>
    <dc:date>2019-03-19T01:00:34Z</dc:date>
    <item>
      <title>Validation Expression is not working in my macro.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Validation-Expression-is-not-working-in-my-macro/m-p/447989#M3975</link>
      <description>&lt;P&gt;I wanted to use macros to change whether or not to perform a subsequent search, depending on the results of a particular field.&lt;BR /&gt;
So, I configured following macro for test, but it isn't working well.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Definition&lt;BR /&gt;
&lt;CODE&gt;eval status=$arg$&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Arguments&lt;BR /&gt;
&lt;CODE&gt;arg&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Validation Expression&lt;BR /&gt;
&lt;CODE&gt;$arg$="OK"&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Validation Error Message&lt;BR /&gt;
&lt;CODE&gt;this is error!&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I tried the following search for the test, but I get an error even if the flag is "OK".&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1 
| eval flag="OK" 
| `test(flag)`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is something wrong with the settings?&lt;BR /&gt;
Or is this a bug?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 09:45:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Validation-Expression-is-not-working-in-my-macro/m-p/447989#M3975</guid>
      <dc:creator>yutaka1005</dc:creator>
      <dc:date>2019-03-18T09:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Validation Expression is not working in my macro.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Validation-Expression-is-not-working-in-my-macro/m-p/447990#M3976</link>
      <description>&lt;P&gt;Hi @yutaka1005&lt;/P&gt;

&lt;P&gt;For the Validation expression use:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;like($arg$, "OK")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Also, since you are specifying that the definition is an eval, do not tick 'use eval based expression' &lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 11:03:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Validation-Expression-is-not-working-in-my-macro/m-p/447990#M3976</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-03-18T11:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Validation Expression is not working in my macro.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Validation-Expression-is-not-working-in-my-macro/m-p/447991#M3977</link>
      <description>&lt;P&gt;Thank you for answer!&lt;/P&gt;

&lt;P&gt;I changed validation expression, but it still not work...&lt;BR /&gt;
(* I didn't tick 'use eval based expression')&lt;/P&gt;

&lt;P&gt;By the way, my splunk version is 7.2.3&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 00:47:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Validation-Expression-is-not-working-in-my-macro/m-p/447991#M3977</guid>
      <dc:creator>yutaka1005</dc:creator>
      <dc:date>2019-03-19T00:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Validation Expression is not working in my macro.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Validation-Expression-is-not-working-in-my-macro/m-p/447992#M3978</link>
      <description>&lt;P&gt;Although I was checking the operation, it seems that the following &lt;CODE&gt;Validation Expression&lt;/CODE&gt; does not apply to the value of field passed as an argument.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;like($arg$, "OK")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;In the above example, the field &lt;CODE&gt;flag&lt;/CODE&gt; is passed, but it seems that &lt;CODE&gt;Validation Expression&lt;/CODE&gt; doesn't judge value of &lt;CODE&gt;flag&lt;/CODE&gt;, but the &lt;CODE&gt;flag&lt;/CODE&gt; as string.&lt;/P&gt;

&lt;P&gt;Is this a specification...?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 01:00:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Validation-Expression-is-not-working-in-my-macro/m-p/447992#M3978</guid>
      <dc:creator>yutaka1005</dc:creator>
      <dc:date>2019-03-19T01:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Validation Expression is not working in my macro.</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Validation-Expression-is-not-working-in-my-macro/m-p/447993#M3979</link>
      <description>&lt;P&gt;マクロのValidation Expressionは使わないのが正解なんじゃないですか？&lt;BR /&gt;
少し検証してみましたが、isnull、isnotnullくらいしかうまく動かない感じです。使いたければこの２つで制御するのをお勧めします。&lt;/P&gt;

&lt;P&gt;Ver.7.0.3&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 01:45:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Validation-Expression-is-not-working-in-my-macro/m-p/447993#M3979</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2019-03-19T01:45:07Z</dc:date>
    </item>
  </channel>
</rss>

