<?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 write a search to only return results where multiple values exist? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-only-return-results-where-multiple/m-p/245303#M73112</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | stats values(device) as devices by user | where mvcount(devices)&amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 22 Nov 2016 21:51:21 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-11-22T21:51:21Z</dc:date>
    <item>
      <title>How to write a search to only return results where multiple values exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-only-return-results-where-multiple/m-p/245301#M73110</link>
      <description>&lt;P&gt;I have a log output which provides many fields, but the two I'm most concerned with are user and device.  &lt;/P&gt;

&lt;P&gt;I'm trying to output a list of users and devices which corresponds with the user from the log data, only in the event that the user has more than one device associated:  I.e.:&lt;/P&gt;

&lt;P&gt;JohnSmith  DeviceA&lt;BR /&gt;
JohnSmith DeviceB&lt;BR /&gt;
SteveSmith DeviceB&lt;BR /&gt;
SteveSmith DeviceC&lt;BR /&gt;
TedSmith DeviceX&lt;BR /&gt;
TedSmith DeviceY&lt;BR /&gt;
TedSmith DeviceZ&lt;/P&gt;

&lt;P&gt;I don't care about users who have only one device assigned, and want to focus on users where the distinct count of devices &amp;gt;1.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 21:17:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-only-return-results-where-multiple/m-p/245301#M73110</guid>
      <dc:creator>drinkingjimmy</dc:creator>
      <dc:date>2016-11-22T21:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to only return results where multiple values exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-only-return-results-where-multiple/m-p/245302#M73111</link>
      <description>&lt;P&gt;Can you try this if you have fields called &lt;CODE&gt;user&lt;/CODE&gt; and &lt;CODE&gt;device&lt;/CODE&gt; to return all the users who have more than once device:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base query to return you the user and device field
| table user, device
| stats count by user
| where count &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR alternatively:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base query to return you the user and device field
| stats values(device) as Devices, dc(device) as DevicesHeld by user
| where DevicesHeld &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Nov 2016 21:45:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-only-return-results-where-multiple/m-p/245302#M73111</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-22T21:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to only return results where multiple values exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-only-return-results-where-multiple/m-p/245303#M73112</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | stats values(device) as devices by user | where mvcount(devices)&amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Nov 2016 21:51:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-only-return-results-where-multiple/m-p/245303#M73112</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-11-22T21:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to only return results where multiple values exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-only-return-results-where-multiple/m-p/245304#M73113</link>
      <description>&lt;P&gt;This was a good solution, but the other was a little simpler.  Thanks for your time!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 22:11:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-only-return-results-where-multiple/m-p/245304#M73113</guid>
      <dc:creator>drinkingjimmy</dc:creator>
      <dc:date>2016-11-22T22:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to only return results where multiple values exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-only-return-results-where-multiple/m-p/245305#M73114</link>
      <description>&lt;P&gt;This seems so obvious now that I see it.  Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 22:11:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-only-return-results-where-multiple/m-p/245305#M73114</guid>
      <dc:creator>drinkingjimmy</dc:creator>
      <dc:date>2016-11-22T22:11:48Z</dc:date>
    </item>
  </channel>
</rss>

