<?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: Where condition not working for a multiple value field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Where-condition-not-working-for-a-multiple-value-field/m-p/574729#M200280</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Nov 2021 11:54:30 GMT</pubDate>
    <dc:creator>neerajs_81</dc:creator>
    <dc:date>2021-11-12T11:54:30Z</dc:date>
    <item>
      <title>Where condition not working for a multiple value field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-condition-not-working-for-a-multiple-value-field/m-p/574703#M200270</link>
      <description>&lt;P&gt;Hello All,&amp;nbsp;&amp;nbsp;&lt;BR /&gt;I have a search that uses stats command and displays the results as follows.&amp;nbsp; Note:&amp;nbsp; I have stripped out some columns.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 sourceType=xxxx
| eventstats count(action) as Per_User_failures by user
| stats latest(_time) as _time, values(host), values(src_ip), dc(src_ip) as srcIpCount, values(user), values(Failure_Reason), dc(user) as userCount, values(Per_User_failures) as Per_User_failures  by Workstation_Name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="neerajs_81_0-1636703489315.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16836i60FAF44B979CE74F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="neerajs_81_0-1636703489315.png" alt="neerajs_81_0-1636703489315.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;neerajs_81_0-1636703489315.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now, if i further add&amp;nbsp; &lt;STRONG&gt;| where Per_User_failures &amp;gt; 10&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;condition, the search shows "No Results Found".&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 sourceType=xxxx
| eventstats count(action) as Per_User_failures by user
| stats latest(_time) as _time, values(host), values(src_ip), dc(src_ip) as srcIpCount, values(user), values(Failure_Reason), dc(user) as userCount, values(Per_User_failures) as Per_User_failures  by Workstation_Name
| where Per_User_failures &amp;gt;10&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This is incorrect&amp;nbsp; as you can see there are some values where Per_user_Failures is greater than 10 such as 11,12,13, 1037 etc.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;How can i make the where clause check any of the values under the "Per_user_failures" column.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 07:57:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-condition-not-working-for-a-multiple-value-field/m-p/574703#M200270</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2021-11-12T07:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition not working for a multiple value field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-condition-not-working-for-a-multiple-value-field/m-p/574710#M200272</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229059"&gt;@neerajs_81&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please replace this with your where condition?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mvexpand Per_User_failures | where Per_User_failures&amp;gt;10 | stats values(*) as * by Workstation_Name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it is works, you can redefine your search and make it possible with only one stats if possible.&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一 &amp;nbsp; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 08:21:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-condition-not-working-for-a-multiple-value-field/m-p/574710#M200272</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-11-12T08:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition not working for a multiple value field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-condition-not-working-for-a-multiple-value-field/m-p/574711#M200273</link>
      <description>&lt;P&gt;Hi Kamlesh, i tried&amp;nbsp; using&lt;STRONG&gt;&amp;nbsp;| mvexpand Per_User_failures | where Per_User_failures&amp;gt;10 ,&amp;nbsp;&lt;BR /&gt;&lt;/STRONG&gt;it appears to be working obviously but the&amp;nbsp; results in the "Per_User_failures" column no longer shows the count of failures per user level.&amp;nbsp; It is now showing only a single value ( which i think is the total of all failures) .&lt;BR /&gt;&lt;BR /&gt;I want the search results to continue displaying count of failures of every user in the "Per_User_failures" column as it was before which is why i am using evenstats to show me the data per user.&lt;BR /&gt;&lt;BR /&gt;This is what i mean :&lt;BR /&gt;Before: ( as per my screenshot earlier) .&amp;nbsp; It shows failures of every user :&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;User&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;userCount&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Per_User_Failures&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;John&lt;BR /&gt;Alice&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;5&lt;BR /&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Alex&lt;BR /&gt;John&lt;BR /&gt;Jamie&lt;BR /&gt;Alicia&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;13&lt;BR /&gt;1037&lt;BR /&gt;12&lt;BR /&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;After adding&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;| mvexpand Per_User_failures | where Per_User_failures&amp;gt;10 &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;User&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;userCount&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Per_User_Failures&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;John&lt;BR /&gt;Alice&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Alex&lt;BR /&gt;John&lt;BR /&gt;Jamie&lt;BR /&gt;Alicia&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;868&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 12 Nov 2021 08:50:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-condition-not-working-for-a-multiple-value-field/m-p/574711#M200273</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2021-11-12T08:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition not working for a multiple value field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-condition-not-working-for-a-multiple-value-field/m-p/574728#M200279</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229059"&gt;@neerajs_81&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you tried same I shared.&lt;/P&gt;&lt;P&gt;I'm sharing my sample search with you. I hope this will help you.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval User="John,Alice|Alex,John,Jamie,Alicia",userCount="2|4",Per_User_Failures="5,10|13,1037,12,1"
    ,User=split(User,"|"),userCount=split(userCount,"|"),Per_User_Failures=split(Per_User_Failures,"|") 
| eval t=mvzip(mvzip(User,userCount,"|"),Per_User_Failures,"|") 
| mvexpand t 
| eval User=mvindex(split(t,"|"),0),userCount=mvindex(split(t,"|"),1),Per_User_Failures=mvindex(split(t,"|"),2) 
| eval User=split(User,","),Per_User_Failures=split(Per_User_Failures,",") 
| eval Workstation_Name=1 | accum Workstation_Name
| rename comment as "Upto now is for sample data only" 
| table User userCount Per_User_Failures Workstation_Name
| mvexpand Per_User_Failures 
| where Per_User_Failures&amp;gt;10
| stats values(*) as * by Workstation_Name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KV&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 11:47:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-condition-not-working-for-a-multiple-value-field/m-p/574728#M200279</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-11-12T11:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition not working for a multiple value field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-condition-not-working-for-a-multiple-value-field/m-p/574729#M200280</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 11:54:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-condition-not-working-for-a-multiple-value-field/m-p/574729#M200280</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2021-11-12T11:54:30Z</dc:date>
    </item>
  </channel>
</rss>

