<?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 on multiple values from multiple fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-on-multiple-values-from-multiple-fields/m-p/271627#M81777</link>
    <description>&lt;P&gt;Can you give this a try please:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query to return username, action, file when searched for "allowed" OR "denied"
| sort username,file
| autoregress username as oldUserName p=1
| autoregress file as oldFileName p=1
| autoregress action as oldAction p=1
| eval tabulate=if( (username=oldUserName) AND (file=oldFileName) AND (action!=oldAction), 1, 0)
| eval zipAction=mvzip(oldAction,action)
| table username, zipAction, file, tabulate
| search tabulate=1
| mvexpand zipAction
| fields - tabulate
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 12 Dec 2016 23:18:42 GMT</pubDate>
    <dc:creator>gokadroid</dc:creator>
    <dc:date>2016-12-12T23:18:42Z</dc:date>
    <item>
      <title>How to filter on multiple values from multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-on-multiple-values-from-multiple-fields/m-p/271626#M81776</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I have a log file that generates about 14 fields I am interested in, and of those fields, I need to look at a couple of fields and correlate on them, but still return the results of all. &lt;/P&gt;

&lt;P&gt;The fields of interest are username, Action, and file. I have limited Action to 2 values, allowed and denied. What I need to show is any username where they had both an allowed action and a denied action for the same file.  For example:&lt;/P&gt;

&lt;P&gt;John allowed temp.txt&lt;BR /&gt;
John Allowed 3.jpg &lt;BR /&gt;
tom allowed temp.txt&lt;BR /&gt;
tom denied temp.txt&lt;BR /&gt;
fred allowed horse.jpg&lt;BR /&gt;
fred allowed pudding.png&lt;BR /&gt;
fred denied horse.jpg&lt;/P&gt;

&lt;P&gt;should look something like this&lt;/P&gt;

&lt;P&gt;username        action         file&lt;BR /&gt;
tom                  allowed      temp.txt&lt;BR /&gt;
tom                 denied         temp.txt&lt;BR /&gt;
fred                allowed        horse.jpg&lt;BR /&gt;
fred                denied          horse.jpg&lt;/P&gt;

&lt;P&gt;I am currently using a &lt;CODE&gt;stats(*) as * username&lt;/CODE&gt; which kind of gets me there, but it leaves me with one line with multiple events and only showing the unique field names for the other 11 fields&amp;gt; However, I need it to show each event specific field values and only if they allowed and denied the same file.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2016 22:53:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-on-multiple-values-from-multiple-fields/m-p/271626#M81776</guid>
      <dc:creator>newill</dc:creator>
      <dc:date>2016-12-12T22:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter on multiple values from multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-on-multiple-values-from-multiple-fields/m-p/271627#M81777</link>
      <description>&lt;P&gt;Can you give this a try please:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query to return username, action, file when searched for "allowed" OR "denied"
| sort username,file
| autoregress username as oldUserName p=1
| autoregress file as oldFileName p=1
| autoregress action as oldAction p=1
| eval tabulate=if( (username=oldUserName) AND (file=oldFileName) AND (action!=oldAction), 1, 0)
| eval zipAction=mvzip(oldAction,action)
| table username, zipAction, file, tabulate
| search tabulate=1
| mvexpand zipAction
| fields - tabulate
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Dec 2016 23:18:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-on-multiple-values-from-multiple-fields/m-p/271627#M81777</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-12-12T23:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter on multiple values from multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-on-multiple-values-from-multiple-fields/m-p/271628#M81778</link>
      <description>&lt;P&gt;This is getting close. However, it only shows me the details from the log entry for one of the events, I need both events details shown, each log entry has its own timestamp and could have slightly different field values for the other 11 fields. &lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2016 14:28:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-on-multiple-values-from-multiple-fields/m-p/271628#M81778</guid>
      <dc:creator>newill</dc:creator>
      <dc:date>2016-12-13T14:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter on multiple values from multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-on-multiple-values-from-multiple-fields/m-p/271629#M81779</link>
      <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search action="allowed" OR action="denied"
| eventstats dc(action) as actions by username file
| where actions=2 | fields - actions
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Dec 2016 14:39:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-on-multiple-values-from-multiple-fields/m-p/271629#M81779</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-12-13T14:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter on multiple values from multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-on-multiple-values-from-multiple-fields/m-p/271630#M81780</link>
      <description>&lt;P&gt;This got me where I needed to be. I did have to add some extra sorting and what nots. Thanks! &lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 15:05:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-on-multiple-values-from-multiple-fields/m-p/271630#M81780</guid>
      <dc:creator>newill</dc:creator>
      <dc:date>2016-12-14T15:05:04Z</dc:date>
    </item>
  </channel>
</rss>

