<?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: need help with IF function in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597679#M208098</link>
    <description>&lt;P&gt;Is this the sort of thing you mean?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval xxx=mvfilter(status IN ("1","2","3"))
| eval yyy=mvfilter(status IN ("4","5"))
| eval zzz=mvappend(if(mvcount(xxx)&amp;gt;0,"A",null()),if(mvcount(yyy)&amp;gt;0,"0",null()))&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 12 May 2022 18:54:29 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-05-12T18:54:29Z</dc:date>
    <item>
      <title>Help using IF function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597676#M208097</link>
      <description>&lt;P&gt;Hi All, i am using IF function like&amp;nbsp;&lt;BR /&gt;|eval xxx= if ( status =="1","A", if(status =="2","A", if(status =="3","A","0")&lt;/P&gt;
&lt;P&gt;its working wherever i have single value in fields like&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Example:-1&lt;/P&gt;
&lt;P&gt;status&amp;nbsp; output&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:- 2&lt;/P&gt;
&lt;P&gt;status&amp;nbsp; &amp;nbsp; &amp;nbsp;output&lt;/P&gt;
&lt;P&gt;1, 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;
&lt;P&gt;2, 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;
&lt;P&gt;1, 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1,4,5,2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in example 2, last values has 1 and 2 with 4 and 5,,, i want to output should be like A and 0 both.&lt;BR /&gt;&lt;BR /&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 19:24:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597676#M208097</guid>
      <dc:creator>saurav47</dc:creator>
      <dc:date>2022-05-12T19:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: need help with IF function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597679#M208098</link>
      <description>&lt;P&gt;Is this the sort of thing you mean?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval xxx=mvfilter(status IN ("1","2","3"))
| eval yyy=mvfilter(status IN ("4","5"))
| eval zzz=mvappend(if(mvcount(xxx)&amp;gt;0,"A",null()),if(mvcount(yyy)&amp;gt;0,"0",null()))&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 12 May 2022 18:54:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597679#M208098</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-12T18:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: need help with IF function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597682#M208099</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;not certainly , here i dont know about value 4 or 5,,, it is just like any other value except 1,2,3, it should give 0 values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;exact query is.. i want to see for any user how many use case got triggered in last 7 days. but i have a some critical use case list of 10 UC. suppose total are 200UC, i want to check if any incident occurred where for any user both use case combination got triggered within 7 days. (any one or more than one use case from 10 uc list ) + any use case from rest 190 UC.&lt;/P&gt;&lt;P&gt;example&amp;nbsp;&lt;/P&gt;&lt;P&gt;user&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;UC triggered in 7 days&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;UC1, UC2, UC87, UC90 UC3&lt;BR /&gt;&lt;BR /&gt;i have given&amp;nbsp;&lt;/P&gt;&lt;P&gt;|eval valuex= if(UC== UC1,1, if(UC== UC2,1, if(UC== UC3,1, if...........if(uc10=="1","0")&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;user&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;UC triggered in 7 days&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; valuesx&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;UC1, UC2, UC87, UC90 UC3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1( want it as 1,0)&lt;BR /&gt;&lt;BR /&gt;so here is the problem,, i am getting valuesx as 1 while it should come 1,0 both as UC triggered having combination.&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 19:15:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597682#M208099</guid>
      <dc:creator>saurav47</dc:creator>
      <dc:date>2022-05-12T19:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: need help with IF function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597743#M208140</link>
      <description>&lt;P&gt;It might be easier if you go back a step - what events are you dealing with?&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 08:21:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597743#M208140</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-13T08:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: need help with IF function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597747#M208143</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;it's not about events...it's just about how splunk function works... It is just i have a value in field ..matching with my values..if yes. .show 1..else 0... Only problem is where field having both values (matched and unmatched) but it's showing only 1...i want 1and 0 both...&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 08:55:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597747#M208143</guid>
      <dc:creator>saurav47</dc:creator>
      <dc:date>2022-05-13T08:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: need help with IF function</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597749#M208145</link>
      <description>&lt;P&gt;An if function either has a result if the criteria is true and a result if the criteria is false - this is a very common paradigm&lt;/P&gt;&lt;P&gt;What I am suggesting is that you might be able to get the result you want if you evaluate the usecase events separately before bringing them together for each user (or whatever criteria you have used).&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 09:02:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-using-IF-function/m-p/597749#M208145</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-13T09:02:37Z</dc:date>
    </item>
  </channel>
</rss>

