<?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: If clause with where in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-use-if-clause-with-where/m-p/647472#M224099</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257202"&gt;@appsik&lt;/a&gt; , your logic is good but there is a typo in your SPL. It should be:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Status=if(Status = 0, "missing file", Status)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Or if you wanted to do partial matching or regex matching you could use match instead:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Status=if(match(Status, "MyRegex"), "missing file", Status)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2023 10:40:51 GMT</pubDate>
    <dc:creator>javiergn</dc:creator>
    <dc:date>2023-06-19T10:40:51Z</dc:date>
    <item>
      <title>What is the best way to use if clause with where?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-use-if-clause-with-where/m-p/647471#M224098</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;
&lt;P&gt;I have a table:&lt;/P&gt;
&lt;P&gt;Filename Status&lt;/P&gt;
&lt;P&gt;file1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;
&lt;P&gt;file2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&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;| eval Status=if(where Status = 0, "missing file", Status)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If Status = 0 I want to replace 0 with "missing file".&lt;/P&gt;
&lt;P&gt;Filename&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Status&lt;/P&gt;
&lt;P&gt;file2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;file missing&lt;/P&gt;
&lt;P&gt;What is the best way to do this?&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 02:38:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-use-if-clause-with-where/m-p/647471#M224098</guid>
      <dc:creator>appsik</dc:creator>
      <dc:date>2023-06-20T02:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: If clause with where</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-use-if-clause-with-where/m-p/647472#M224099</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257202"&gt;@appsik&lt;/a&gt; , your logic is good but there is a typo in your SPL. It should be:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Status=if(Status = 0, "missing file", Status)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Or if you wanted to do partial matching or regex matching you could use match instead:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Status=if(match(Status, "MyRegex"), "missing file", Status)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 10:40:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-use-if-clause-with-where/m-p/647472#M224099</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2023-06-19T10:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: If clause with where</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-use-if-clause-with-where/m-p/647475#M224102</link>
      <description>&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 11:02:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-best-way-to-use-if-clause-with-where/m-p/647475#M224102</guid>
      <dc:creator>appsik</dc:creator>
      <dc:date>2023-06-19T11:02:57Z</dc:date>
    </item>
  </channel>
</rss>

