<?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 filter multiple values in a given field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609867#M212075</link>
    <description>&lt;P&gt;Can you try&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where mvcount('values(logins)') &amp;gt; 2&lt;/LI-CODE&gt;&lt;P&gt;or if this is not working then 1st rename that values(logins) to new name and then use it inside mvcount.&lt;/P&gt;&lt;P&gt;r. Ismo&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2022 20:32:25 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2022-08-17T20:32:25Z</dc:date>
    <item>
      <title>How to filter multiple values in a given field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609752#M212026</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hi all, I am new at Splunk and trying to evaluate this query.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I have some accounts, dates(week starting) and number of browsers used&amp;nbsp; by the account for that date.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I have grouped the dates and number_of_browsers. there is 1 account but multiple dates and multiple&amp;nbsp; or single values for browser_types. My query:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;index="a" source type="ab"| rename Week Starting&amp;nbsp;AS Date&lt;BR /&gt;| stats sum(browser_ types) AS New_BrowserTypes by AccountID TotalUsers Date&lt;BR /&gt;| eval New_BrowserTypes= round(New_BrowserTypes/TotalUsers,2)&lt;BR /&gt;| stats MAX(New_BrowserTypes) as logins by AccountID Date&lt;BR /&gt;| stats values(Date) values(logins) by AccountID&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;BR /&gt;which gives an output something like this:&lt;/FONT&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;AccountID&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;values(date)&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;values(logins)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;502&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;2020-07-20&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;20.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="25px"&gt;102&lt;/TD&gt;
&lt;TD height="25px"&gt;2020-07-20&lt;/TD&gt;
&lt;TD height="25px"&gt;15.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD height="25px"&gt;2020-08-25&lt;/TD&gt;
&lt;TD height="25px"&gt;18.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;304&lt;/TD&gt;
&lt;TD&gt;2020-07-20&lt;/TD&gt;
&lt;TD&gt;24.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;2020-08-25&lt;/TD&gt;
&lt;TD&gt;18.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;2021-07-20&lt;/TD&gt;
&lt;TD&gt;25.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD height="25px"&gt;2021-08-25&lt;/TD&gt;
&lt;TD height="25px"&gt;15.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the final result, I want to use AccountID's where values(logins) are &amp;gt;1. So I want to use only those accounts where, logins are 2 or more. how do I achieve this? thank you in advance.&amp;nbsp; Please not this is only an example, my actual AccountID's are more than 500.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 14:38:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609752#M212026</guid>
      <dc:creator>hmohta</dc:creator>
      <dc:date>2022-08-17T14:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter multiple values in a given field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609761#M212029</link>
      <description>&lt;P&gt;Based on your SPL, the resultant&amp;nbsp;&lt;SPAN&gt;values(Date) and values(logins) are both multivalued; thus, I speculate that the output looks more like&lt;/SPAN&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;AccountID&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;values(Date)&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;values(logins)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;502&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2020-07-20&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;20.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;102&lt;/TD&gt;&lt;TD height="25px"&gt;&lt;P&gt;2020-07-20&lt;BR /&gt;2020-08-25&lt;/P&gt;&lt;/TD&gt;&lt;TD height="25px"&gt;&lt;P&gt;15.00&lt;BR /&gt;18.00&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;304&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2020-07-20&lt;BR /&gt;2020-08-25&lt;BR /&gt;2021-07-20&lt;BR /&gt;2021-08-25&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;15.00&lt;BR /&gt;18.00&lt;BR /&gt;24.00&lt;BR /&gt;25.00&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;So, you will need to clarify your criteria "&lt;SPAN&gt;only those accounts where, logins are 2 or more.&lt;/SPAN&gt;" &amp;nbsp;Are you selecting those whose "logins" are 2 or more on each selected "Date"? or in aggregate after all Dates?&lt;/P&gt;&lt;P&gt;Assuming it is the former (select Dates), you can do something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="a" source type="ab"| rename "Week Starting" AS Date
| stats sum(browser_types) AS New_BrowserTypes by AccountID TotalUsers Date
| eval New_BrowserTypes= round(New_BrowserTypes/TotalUsers,2)
| stats MAX(New_BrowserTypes) as logins by AccountID Date
| where logins &amp;gt; 2
| stats values(Date) values(logins) by AccountID&lt;/LI-CODE&gt;&lt;P&gt;If you need the latter (aggregate), try something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="a" source type="ab"| rename "Week Starting" AS Date
| stats sum(browser_types) AS New_BrowserTypes by AccountID TotalUsers Date
| eval New_BrowserTypes= round(New_BrowserTypes/TotalUsers,2)
| stats MAX(New_BrowserTypes) as logins by AccountID Date
| stats values(Date) values(logins) sum(logins) as Aggregate_Logins by AccountID​
| where Aggregate_Logins &amp;gt; 2&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 17 Aug 2022 06:38:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609761#M212029</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-17T06:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter multiple values in a given field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609764#M212031</link>
      <description>&lt;P&gt;thankyou for your prompt reply. I am after results where ALL Dates are suppose to include. Yes your output table is better than mine:). your reply for aggregate give me the total of values for all accounts where aggregate is &amp;gt;2. thankyou. But I am not after aggregate, rather I want to use/see "only" those AccountID's where "&lt;SPAN&gt;values(logins)" is &amp;gt;2. so I want AccountID's like 102,304 only to appear for&amp;nbsp; my output.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this is better.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 06:48:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609764#M212031</guid>
      <dc:creator>hmohta</dc:creator>
      <dc:date>2022-08-17T06:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter multiple values in a given field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609782#M212044</link>
      <description>&lt;P&gt;Still unclear what is unique about 102 and 304, because in your sample output, 502 has 20 logins. &amp;nbsp;But anyway, if you simply want to select any values(login) is greater than 2, put a single quote across this output in where command, like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="a" source type="ab"| rename "Week Starting" AS Date
| stats sum(browser_types) AS New_BrowserTypes by AccountID TotalUsers Date
| eval New_BrowserTypes= round(New_BrowserTypes/TotalUsers,2)
| stats MAX(New_BrowserTypes) as logins by AccountID Date
| stats values(Date) values(logins) by AccountID​
| where 'values(logins)' &amp;gt; 2&lt;/LI-CODE&gt;&lt;P&gt;Most people choose to add "AS" clause to those values() function to get rid of the single quote nuisance.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 07:31:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609782#M212044</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-08-17T07:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter multiple values in a given field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609794#M212053</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;.thankyou for replying. Let me try this again. ( I have attached the table again)&lt;/P&gt;&lt;P&gt;AccountID-502 : has only 1 value of "20".&lt;/P&gt;&lt;P&gt;AccountID 102 and 304 have 2 and 4 values respectively. Now I have tried your suggestions of&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| where 'values(logins)' &amp;gt; 2&lt;/PRE&gt;&lt;P&gt;But this singles out all Dates. I want the Values(date) to remain grouped. So in this instance I don't want AccountID502 as it has only 1 value. I want my final output which shows only those&amp;nbsp; AccountID's where "values(logins)"&amp;nbsp; are &amp;gt;=2 values.&amp;nbsp; So in this instance 102 and 304.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;AccountID&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;values(Date)&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;values(logins)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;502&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2020-07-20&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;20.00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;102&lt;/TD&gt;&lt;TD height="25px"&gt;&lt;P&gt;2020-07-20&lt;BR /&gt;2020-08-25&lt;/P&gt;&lt;/TD&gt;&lt;TD height="25px"&gt;&lt;P&gt;15.00&lt;BR /&gt;18.00&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;304&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2020-07-20&lt;BR /&gt;2020-08-25&lt;BR /&gt;2021-07-20&lt;BR /&gt;2021-08-25&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;15.00&lt;BR /&gt;18.00&lt;BR /&gt;24.00&lt;BR /&gt;25.00&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 17 Aug 2022 07:58:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609794#M212053</guid>
      <dc:creator>hmohta</dc:creator>
      <dc:date>2022-08-17T07:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter multiple values in a given field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609867#M212075</link>
      <description>&lt;P&gt;Can you try&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where mvcount('values(logins)') &amp;gt; 2&lt;/LI-CODE&gt;&lt;P&gt;or if this is not working then 1st rename that values(logins) to new name and then use it inside mvcount.&lt;/P&gt;&lt;P&gt;r. Ismo&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 20:32:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609867#M212075</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2022-08-17T20:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter multiple values in a given field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609883#M212077</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp; Worked like a charm, thankyou so much!!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 22:48:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-multiple-values-in-a-given-field/m-p/609883#M212077</guid>
      <dc:creator>hmohta</dc:creator>
      <dc:date>2022-08-17T22:48:11Z</dc:date>
    </item>
  </channel>
</rss>

