<?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: JOIN to list user per DeviceId in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399136#M115727</link>
    <description>&lt;P&gt;Thanks but this only returned 60 results whereas my original search returns 146 results.&lt;/P&gt;

&lt;P&gt;I cant upload a screenshot but this search returned all users who have MobileIron (listing several DeviceId's per user) but it did not include those users who don't have it. The source aduserscan contains all users within the companyOu.&lt;/P&gt;</description>
    <pubDate>Tue, 15 May 2018 14:27:38 GMT</pubDate>
    <dc:creator>davidcraven02</dc:creator>
    <dc:date>2018-05-15T14:27:38Z</dc:date>
    <item>
      <title>JOIN to list user per DeviceId</title>
      <link>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399132#M115723</link>
      <description>&lt;P&gt;Search is trying to show all users within the companyOu that have Mobile Iron setup (Status=Allowed) and those that do not (Mobile Iron not setup)&lt;/P&gt;

&lt;P&gt;The below search is only showing one user listed but some users have more than one DeviceId configured. I can't work out why all DeviceId's are not showing for a user.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ad source=aduserscan 
| table samAccountName, companyOu, displayName 
| search samAccountName=*_cp companyOu=dacp.com 
| rename samAccountName as MailboxId 
| join type=left MailboxId 
    [ search index=msexchange source=otl_mobileiron MailboxId=*_cp 
    | dedup DeviceId 
    | search Retired="false" ] 
| rename companyOu as Company, MailboxId as "User ID", DeviceFriendlyName as Model, displayName as "Display Name", SyncStatus as Status 
| fillnull value="Mobile Iron not setup" Status 
| table Company, "User ID", "Display Name", "Status" DeviceId
| sort Company asc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4962i69B7C566EBCB17CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 10:40:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399132#M115723</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2018-05-15T10:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: JOIN to list user per DeviceId</title>
      <link>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399133#M115724</link>
      <description>&lt;P&gt;can you try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ad source=aduserscan samAccountName=*_cp companyOu=dacp.com 
| stats count by samAccountName, companyOu, displayName 
| rename samAccountName as MailboxId 
| join type=left MailboxId 
    [ search index=msexchange source=otl_mobileiron MailboxId=*_cp Retired="false" 
    | dedup MailboxId DeviceId] 
| rename companyOu as Company, MailboxId as "User ID", DeviceFriendlyName as Model, displayName as "Display Name", SyncStatus as Status 
| fillnull value="Mobile Iron not setup" Status 
| table Company, "User ID", "Display Name", "Status" DeviceId 
| sort Company asc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 May 2018 12:39:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399133#M115724</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-05-15T12:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: JOIN to list user per DeviceId</title>
      <link>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399134#M115725</link>
      <description>&lt;P&gt;Thanks but this is gives the same number of results only a more efficient way to run it.&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 13:45:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399134#M115725</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2018-05-15T13:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: JOIN to list user per DeviceId</title>
      <link>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399135#M115726</link>
      <description>&lt;P&gt;@davidcraven02, Can you try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=msexchange source=otl_mobileiron MailboxId=*_cp Retired="false" 
| dedup MailboxId DeviceId 
| rename MailboxId as samAccountName 
| join type=left samAccountName 
    [ search index=ad source=aduserscan samAccountName=*_cp companyOu=dacp.com 
    | dedup samAccountName, companyOu, displayName ] 
| rename companyOu as Company, samAccountName as "User ID", DeviceFriendlyName as Model, displayName as "Display Name", SyncStatus as Status 
| fillnull value="Mobile Iron not setup" Status 
| table Company, "User ID", "Display Name", "Status" DeviceId 
| sort Company asc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If this does not work, can you share example of which record from specific index does not show up? Mock/Anonymize sensitive data.&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 13:59:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399135#M115726</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-15T13:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: JOIN to list user per DeviceId</title>
      <link>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399136#M115727</link>
      <description>&lt;P&gt;Thanks but this only returned 60 results whereas my original search returns 146 results.&lt;/P&gt;

&lt;P&gt;I cant upload a screenshot but this search returned all users who have MobileIron (listing several DeviceId's per user) but it did not include those users who don't have it. The source aduserscan contains all users within the companyOu.&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 14:27:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399136#M115727</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2018-05-15T14:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: JOIN to list user per DeviceId</title>
      <link>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399137#M115728</link>
      <description>&lt;P&gt;@davidcraven02 without having a look at some data values from events for the two sources, it would be difficult to come up with exact query, but can you try a different approach to check whether all Device IDs for various MailBoxIds show up&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( index=msexchange source=otl_mobileiron MailboxId=*_cp Retired="false" ) OR (index=ad source=aduserscan samAccountName=*_cp companyOu=dacp.com)
| rename samAccountName as MailboxId 
| stats count values(DeviceId) as DeviceId by MailboxId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 May 2018 14:56:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399137#M115728</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-15T14:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: JOIN to list user per DeviceId</title>
      <link>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399138#M115729</link>
      <description>&lt;P&gt;This returned 146 results which is the total number of users for this company. However each MailboxId has a count of 1 and no DeviceId is displayed.&lt;/P&gt;

&lt;P&gt;MailboxId   count   DeviceId&lt;BR /&gt;
Haver_cp    1&lt;BR /&gt;&lt;BR /&gt;
dadams_cp   1    &lt;/P&gt;

&lt;P&gt;For&lt;CODE&gt;index=msexchange source=otl_mobileiron MailboxId=*_cp Retired="false"&lt;/CODE&gt; the user field is called MailboxId not samAccountName. &lt;/P&gt;

&lt;P&gt;And the user field for &lt;CODE&gt;index=ad source=aduserscan&lt;/CODE&gt;is  called samAccountName&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( index=msexchange source=otl_mobileiron MailboxId=*_cp Retired="false" )
      | stats count values(DeviceId) as DeviceId by MailboxId
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I search the above I get the below data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;MailboxId   count   DeviceId
abon_cp          1         nine54011c5277ab
acavez_cp   1         ninebe03364cd694
acori_cp            1        iqj4udgc1h1q31j8vik9vceflo
akura_cp    1        rbmm3dea9d45v2kbt1rs36a7ok
aruma_cp    2        e53fd31687aa1ae3
                                     ninea8a1b3156df0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:32:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399138#M115729</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2020-09-29T19:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: JOIN to list user per DeviceId</title>
      <link>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399139#M115730</link>
      <description>&lt;P&gt;@davidcraven02, give the following a try, see whether matches for MailboxIds are coming from both sources &lt;CODE&gt;otl_mobileiron&lt;/CODE&gt; and &lt;CODE&gt;aduserscan&lt;/CODE&gt; or not.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( index=msexchange source=otl_mobileiron MailboxId=*_cp Retired="false" ) OR (index=ad source=aduserscan samAccountName=*_cp companyOu=dacp.com)
 | eval MailboxId=coalesce(MailboxId,samAccountName)
 | stats count values(source) as source  values(DeviceId) as DeviceId by MailboxId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 May 2018 16:17:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/JOIN-to-list-user-per-DeviceId/m-p/399139#M115730</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-15T16:17:44Z</dc:date>
    </item>
  </channel>
</rss>

