<?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: Compare Multivalue Fields With Lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/564251#M196555</link>
    <description>&lt;P&gt;Try something made to give you a comparison of multivalue fields and can return a multivalue field of the intersecting values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://splunkbase.splunk.com/app/5694/" target="_blank"&gt;MVCompare | Splunkbase&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Aug 2021 02:26:05 GMT</pubDate>
    <dc:creator>theChain</dc:creator>
    <dc:date>2021-08-23T02:26:05Z</dc:date>
    <item>
      <title>Compare Multivalue Fields With Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536077#M151562</link>
      <description>&lt;P&gt;Greetings Splunkers,&lt;BR /&gt;&lt;BR /&gt;I've been banging my head against the keyboard to try and resolve this comparison issue, I know there's a way to do it I just can't seem to figure it out.&lt;BR /&gt;&lt;BR /&gt;The issue I'm trying to resolve is determining if a user has a conflict of interest with regard to roles their user has been assigned, and what management deems inappropriate, segregation of duties basically.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get my list of conflicting roles from a lookup.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- lookup SoD.csv Department as Department OUTPUTNEW Conflicting_Roles, Justification&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cquinney_1-1610749823715.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12561iEFA7D0529987611E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cquinney_1-1610749823715.png" alt="cquinney_1-1610749823715.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So if USER_A is within the Finance department and assigned roles A, B, and C&amp;nbsp; &amp;nbsp;OR&amp;nbsp; &amp;nbsp; A, B, and Z for example it would be a conflict because they still have A &amp;amp; B.&amp;nbsp;&amp;nbsp;I can get a proper result when I manually input the roles within a case statement.&lt;BR /&gt;&lt;BR /&gt;Conflict=case(Assigned_Role=Role_B AND Assigned_Role=Role_C, "Conflict",1=1,"No Conflict")&lt;BR /&gt;&lt;BR /&gt;However, given the conflicting roles change based on the department, it will be easier, in the long run, to maintain a lookup for conflicting roles than continuously updating the query.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried the following but none seem to work:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Conflict=case(in(Roles,Conflicting_Roles), "True",1=1, "False")&lt;/LI&gt;&lt;LI&gt;Conflict=if(isnotnull(mvfind(Roles,Conflicting_Roles)),"Matched","Not Matched")&lt;/LI&gt;&lt;LI&gt;Conflict=if(match(Roles,Conflicting_Roles),"Conflict","No Conflict")&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;None seem to work as I need though, any thoughts or suggestions are greatly appreciated. Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 22:52:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536077#M151562</guid>
      <dc:creator>cquinney</dc:creator>
      <dc:date>2021-01-15T22:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Multivalue Fields With Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536081#M151564</link>
      <description>&lt;P&gt;match(multivalue_field,single_value) can work.&lt;/P&gt;&lt;P&gt;mvfind'usage is&amp;nbsp; mvfind(MVFIELD,"REGEX")&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.1/SearchReference/MultivalueEvalFunctions" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.1/SearchReference/MultivalueEvalFunctions&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sample:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults
| eval _raw="User Role Department
A Role_B Tec Team
B Role_B HR"
| multikv forceheader=1 
| table User Role Department
| join Department [| makeresults
| eval _raw="Department  Conflicting_Roles  Justification
Tec Team  Role_B\nRole_C  Management Said so.
HR        Role_A\nRole_C  Management Said so.
Financial Role_A\nRole_B  Management Said so."
| multikv forceheader=1
| eval Conflicting_Roles=split(Conflicting_Roles,"\n")
| table Department  Conflicting_Roles  Justification]
| eval result=if(match(Conflicting_Roles,Role),"True","False")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 15 Jan 2021 23:30:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536081#M151564</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2021-01-15T23:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Multivalue Fields With Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536225#M151615</link>
      <description>&lt;P&gt;Hi&amp;nbsp;to4kawa,&lt;/P&gt;&lt;P&gt;Thank you for the help, unfortunately, I continue to get false readings when a user has more than two roles assigned.&amp;nbsp; I've attached a screenshot showing what I mean.&amp;nbsp; Any additional thoughts?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 16:09:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536225#M151615</guid>
      <dc:creator>cquinney</dc:creator>
      <dc:date>2021-01-18T16:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Multivalue Fields With Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536277#M151622</link>
      <description>&lt;P&gt;&amp;gt;match(multivalue_field,&lt;STRONG&gt;single_value)&lt;/STRONG&gt; can work.&lt;/P&gt;&lt;P&gt;your query result is both multi-values. please separate to single value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 02:23:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536277#M151622</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2021-01-19T02:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Multivalue Fields With Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536337#M151644</link>
      <description>&lt;P&gt;Unfortunately, I require both values to be compared in their multi-valued state.&amp;nbsp; Otherwise, I continue to get false positives when a user has one of the conflicting roles but not a second or third which makes it "conflicting".&amp;nbsp;&lt;/P&gt;&lt;P&gt;A user can have a combination of the following roles and not be considered a conflict:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1.&amp;nbsp; ZSRM_CENTRAL_SHOPPER &amp;amp;&amp;nbsp;ZSRM_PROCESSINBOX&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2.&amp;nbsp;ZSRM_PROCESSINBOX &amp;amp;&amp;nbsp;ZSRM_PURCHASING_BUYER&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, a user cannot have all three (ZSRM_CENTRAL_SHOPPER, ZSRM_PROCESSINBOX &amp;amp;&amp;nbsp;ZSRM_PURCHASING_BUYER).&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;T&lt;/SPAN&gt;&lt;SPAN&gt;herein lies the conflict that I'm trying to detect.&amp;nbsp; When I separate either the conflicting roles combination or the assigned user roles into a single value I get false positives for users that only have one of the conflicting roles but not both.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 14:33:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536337#M151644</guid>
      <dc:creator>cquinney</dc:creator>
      <dc:date>2021-01-19T14:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Multivalue Fields With Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536398#M151661</link>
      <description>&lt;LI-CODE lang="javascript"&gt;| makeresults 
| eval _raw="User Role Department
A ZSRM_PROCESSINBOX\nZSRM_PURCHASING_BUYER\nZSRM_CENTRAL_SHOPPER Tec Team
B ZSRM_PROCESSINBOX\nZSRM_PURCHASING_BUYER HR" 
| multikv forceheader=1
| eval Role=split(Role,"\n") 
| table User Role Department 
| join Department 
    [| makeresults 
    | eval _raw="Department  Conflicting_Roles  Justification
Tec Team   ZSRM_CENTRAL_SHOPPER\nZSRM_PROCESSINBOX   Management Said so.
HR        ZSRM_PROCESSINBOX\nZSRM_PURCHASING_BUYER  Management Said so.
Financial ZSRM_PROCESSINBO\nZSRM_PURCHASING_BUYER  Management Said so." 
    | multikv forceheader=1 
    | eval Conflicting_Roles=split(Conflicting_Roles,"\n") 
    | table Department Conflicting_Roles Justification]
| rename COMMENT as "this is sample, from here, check sequence."
| mvexpand Role
| streamstats count(Role) as Role_count by User
| eval check_role=if(match(Conflicting_Roles,Role),"True","False")
| eventstats max(Role_count) as count count(eval(check_role="True")) as checked by User
| eval Conflict=if(count &amp;gt; checked ,"Conflict" ,"None")
```
| fields - Role_count check_role checked count
| stats values(*) as * by User
```&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 19 Jan 2021 21:44:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536398#M151661</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2021-01-19T21:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Multivalue Fields With Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536443#M151677</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/162002"&gt;@cquinney&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can sort multi values and then compare. Check if this works for you.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="User,Role,Department,Conflicting_Roles,Justification
A,ZSRM_PROCESSINBOX;ZSRM_PURCHASING_BUYER;ZSRM_CENTRAL_SHOPPER,Tec Team,ZSRM_CENTRAL_SHOPPER;ZSRM_PROCESSINBOX,Management Said so.
B,ZSRM_PROCESSINBOX;ZSRM_PURCHASING_BUYER,HR,ZSRM_PROCESSINBOX;ZSRM_PURCHASING_BUYER,Management Said so.
C,ZSRM_CENTRAL_SHOPPER;ZSRM_PROCESSINBOX,HR,ZSRM_PROCESSINBOX;ZSRM_PURCHASING_BUYER,Management Said so.
D,ZSRM_PURCHASING_BUYER;ZSRM_CENTRAL_SHOPPER,Tec Team,ZSRM_CENTRAL_SHOPPER;ZSRM_PROCESSINBOX,Management Said so." 
| multikv forceheader=1 
| eval Role=split(Role,";"), Conflicting_Roles=split(Conflicting_Roles,";") 
| table User Role Department Conflicting_Roles Justification 
| eval nRole=mvjoin(mvsort(Role), ","), nConflicting_Roles=mvjoin(mvsort(Conflicting_Roles), ",") 
| eval result=if(match(nRole, nConflicting_Roles), "Conflict", "No Conflict") | fields - nRole, nConflicting_Roles&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 20 Jan 2021 07:31:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/536443#M151677</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-01-20T07:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Multivalue Fields With Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/564251#M196555</link>
      <description>&lt;P&gt;Try something made to give you a comparison of multivalue fields and can return a multivalue field of the intersecting values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://splunkbase.splunk.com/app/5694/" target="_blank"&gt;MVCompare | Splunkbase&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 02:26:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-Multivalue-Fields-With-Lookup/m-p/564251#M196555</guid>
      <dc:creator>theChain</dc:creator>
      <dc:date>2021-08-23T02:26:05Z</dc:date>
    </item>
  </channel>
</rss>

