<?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: Splunk eval if with wildcard in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-eval-if-with-wildcard/m-p/438538#M124810</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="balblableaw" 
 | append 
     [| makeresults 
     | eval app_name ="ingestion_something"] 
 | append 
     [| makeresults 
     | eval app_name ="should-match-only"] 
 | eval not_contains_ingestion = if(app_name like "ingestion%" ,1,0) 
 | table app_name, not_contains_ingestion
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 31 Jan 2019 13:47:14 GMT</pubDate>
    <dc:creator>vishaltaneja070</dc:creator>
    <dc:date>2019-01-31T13:47:14Z</dc:date>
    <item>
      <title>Splunk eval if with wildcard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-eval-if-with-wildcard/m-p/438536#M124808</link>
      <description>&lt;P&gt;Im trying to set a boolean based on a match in a string.&lt;BR /&gt;
I want to set a value to 1 if it does not match ingestion* and set it to 0 if it does match.&lt;BR /&gt;
The following example shows the problem:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="balblableaw" 
| append 
    [| makeresults 
    | eval app_name ="ingestion_something"] 
| append 
    [| makeresults 
    | eval app_name ="should-match-only"] 
| eval not_contains_ingestion = if(app_name!="ingestion*",1,0) 
| table app_name, not_contains_ingestion
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The expected result was that should-match-only would be 1 and the ingestion_something would be 0&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6468iB935425CA4180CB7/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 13:41:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-eval-if-with-wildcard/m-p/438536#M124808</guid>
      <dc:creator>sboogaar</dc:creator>
      <dc:date>2019-01-31T13:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk eval if with wildcard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-eval-if-with-wildcard/m-p/438537#M124809</link>
      <description>&lt;P&gt;@sboogaar,&lt;/P&gt;

&lt;P&gt;Use &lt;CODE&gt;match&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="balblableaw" 
 | append 
     [| makeresults 
     | eval app_name ="ingestion_something"] 
 | append 
     [| makeresults 
     | eval app_name ="should-match-only"] 
 | eval not_contains_ingestion = if(match(app_name,"ingestion"),0,1) 
 | table app_name, not_contains_ingestion
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Jan 2019 13:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-eval-if-with-wildcard/m-p/438537#M124809</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-01-31T13:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk eval if with wildcard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-eval-if-with-wildcard/m-p/438538#M124810</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="balblableaw" 
 | append 
     [| makeresults 
     | eval app_name ="ingestion_something"] 
 | append 
     [| makeresults 
     | eval app_name ="should-match-only"] 
 | eval not_contains_ingestion = if(app_name like "ingestion%" ,1,0) 
 | table app_name, not_contains_ingestion
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Jan 2019 13:47:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-eval-if-with-wildcard/m-p/438538#M124810</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2019-01-31T13:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk eval if with wildcard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-eval-if-with-wildcard/m-p/438539#M124811</link>
      <description>&lt;P&gt;Thanks for the answer, can you explain why my own example was not working. I try to understand the disabilities from splunk.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:30:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-eval-if-with-wildcard/m-p/438539#M124811</guid>
      <dc:creator>sboogaar</dc:creator>
      <dc:date>2019-02-01T12:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk eval if with wildcard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-eval-if-with-wildcard/m-p/438540#M124812</link>
      <description>&lt;P&gt;In eval it doesn't treat * as wildcard but as literal&lt;/P&gt;</description>
      <pubDate>Sat, 02 Feb 2019 13:00:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-eval-if-with-wildcard/m-p/438540#M124812</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-02-02T13:00:13Z</dc:date>
    </item>
  </channel>
</rss>

