<?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: how to use a wild card in if condition in eval? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-a-wild-card-in-if-condition-in-eval/m-p/502808#M139921</link>
    <description>&lt;P&gt;You cannot; you must use something else like &lt;CODE&gt;like&lt;/CODE&gt; or &lt;CODE&gt;match&lt;/CODE&gt; or &lt;CODE&gt;searchmatch&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval Project=if(match(app, "^abc_"), "XYZ", "ZXT")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 24 Mar 2020 20:47:42 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2020-03-24T20:47:42Z</dc:date>
    <item>
      <title>how to use a wild card in if condition in eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-a-wild-card-in-if-condition-in-eval/m-p/502807#M139920</link>
      <description>&lt;P&gt;I have an eval condition as below which is working good.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Project=if(app=="abc_def_123", "XYZ", "ZXT")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now If I have given a wild card as shown below it's not working. How can I apply the wild card as shown below and get the required results?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Project=if(app=="abc_*", "XYZ", "ZXT")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Mar 2020 20:32:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-a-wild-card-in-if-condition-in-eval/m-p/502807#M139920</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2020-03-24T20:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to use a wild card in if condition in eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-a-wild-card-in-if-condition-in-eval/m-p/502808#M139921</link>
      <description>&lt;P&gt;You cannot; you must use something else like &lt;CODE&gt;like&lt;/CODE&gt; or &lt;CODE&gt;match&lt;/CODE&gt; or &lt;CODE&gt;searchmatch&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval Project=if(match(app, "^abc_"), "XYZ", "ZXT")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Mar 2020 20:47:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-a-wild-card-in-if-condition-in-eval/m-p/502808#M139921</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-24T20:47:42Z</dc:date>
    </item>
  </channel>
</rss>

