<?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 How to modify my search to show users who have visited both category=&amp;quot;Entertainment&amp;quot; and category=&amp;quot;Business&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230574#M68365</link>
    <description>&lt;P&gt;I'm using following search but it's not working:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=proxy_logs  category="Entertainment"  category="Business" | stats ..
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search is not giving results but in logs I have users who visited sites with both categories.&lt;/P&gt;

&lt;P&gt;Like a user visited site1 with category="Entertainment" and while further surfing, he visited another site2 category="Business".&lt;BR /&gt;
I need to find such users.&lt;/P&gt;

&lt;P&gt;If using this search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=bluecoat  category="Translation" OR category="Pornography" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it is giving results. But in those results, I have users who accessed either one of them not &lt;STRONG&gt;both of  them&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;Please tell me if you need more information.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Oct 2016 10:24:08 GMT</pubDate>
    <dc:creator>ivar9692</dc:creator>
    <dc:date>2016-10-05T10:24:08Z</dc:date>
    <item>
      <title>How to modify my search to show users who have visited both category="Entertainment" and category="Business"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230574#M68365</link>
      <description>&lt;P&gt;I'm using following search but it's not working:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=proxy_logs  category="Entertainment"  category="Business" | stats ..
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search is not giving results but in logs I have users who visited sites with both categories.&lt;/P&gt;

&lt;P&gt;Like a user visited site1 with category="Entertainment" and while further surfing, he visited another site2 category="Business".&lt;BR /&gt;
I need to find such users.&lt;/P&gt;

&lt;P&gt;If using this search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=bluecoat  category="Translation" OR category="Pornography" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it is giving results. But in those results, I have users who accessed either one of them not &lt;STRONG&gt;both of  them&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;Please tell me if you need more information.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 10:24:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230574#M68365</guid>
      <dc:creator>ivar9692</dc:creator>
      <dc:date>2016-10-05T10:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to show users who have visited both category="Entertainment" and category="Business"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230575#M68366</link>
      <description>&lt;P&gt;I don't have the answer, but the problem with your first search is that it is looking for single events that contain both categories at the same time, which is not possible with single value fields.&lt;BR /&gt;
Fear not, I'm sure someone will show you how to use your search and sort them out by user so that only users that did both in different events are listed.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 00:43:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230575#M68366</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2016-10-06T00:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to show users who have visited both category="Entertainment" and category="Business"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230576#M68367</link>
      <description>&lt;P&gt;Try like this. Replace PutYourUserFieldHere  with the field that you want to use for user&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=bluecoat  category="Translation" OR category="Pornography"  | stats values(category) as category by PutYourUserFieldHere | where mvcount(category)=2 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Oct 2016 06:29:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230576#M68367</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-06T06:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to show users who have visited both category="Entertainment" and category="Business"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230577#M68368</link>
      <description>&lt;P&gt;try this if your user name field is say "userName":&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;index=bluecoat  category="Translation" OR category="Pornography"   | stats dc(category) as distinctCategory by userName| where distinctCategory&amp;gt;=2&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 07:02:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230577#M68368</guid>
      <dc:creator>govindsinghrawa</dc:creator>
      <dc:date>2016-10-06T07:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to show users who have visited both category="Entertainment" and category="Business"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230578#M68369</link>
      <description>&lt;P&gt;Please check this one - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=proxy_logs  category="Entertainment"  [ search index=proxy_logs category="Business" | table UserNames ] | stats ..
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Oct 2016 07:36:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230578#M68369</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-10-06T07:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify my search to show users who have visited both category="Entertainment" and category="Business"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230579#M68370</link>
      <description>&lt;P&gt;Hi @ivar9692 - Looks like you have a few possible solutions to your question. If one of them provided a working solution, please don't forget to click "Accept" below the best answer to resolve this post. If you still need help, please leave a comment. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 03:25:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-modify-my-search-to-show-users-who-have-visited-both/m-p/230579#M68370</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2016-10-24T03:25:48Z</dc:date>
    </item>
  </channel>
</rss>

