<?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 compile 3 searches into one to get the following Information: SAML Group, Splunk Role, index? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/641991#M222389</link>
    <description>&lt;P&gt;Unfortunately the null value is not being used when one of the fields doesn't match.&amp;nbsp; For instance if I have a SAML value, but it hasn't been mapped to a role yet, I would want a null value as the value for that role field.&amp;nbsp; Is that possible with the search?&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2023 11:54:36 GMT</pubDate>
    <dc:creator>NanSplk01</dc:creator>
    <dc:date>2023-05-02T11:54:36Z</dc:date>
    <item>
      <title>How to compile 3 searches into one to get the following Information: SAML Group, Splunk Role, index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/640854#M222031</link>
      <description>&lt;P&gt;These are the 3 searches I have found, but I need to combine them so that I can get the information all out on one search.&amp;nbsp; Also, how can I then take this and use a rest API with Azure to get the SAML Group real name?&lt;/P&gt;
&lt;P&gt;This search gives indexes attached to roles&lt;/P&gt;
&lt;P&gt;| rest /services/authorization/roles | table title srchIndexesAllowed&lt;/P&gt;
&lt;P&gt;This search gives you SAML ID and Roles&lt;/P&gt;
&lt;P&gt;| rest /services/admin/SAML-groups&lt;BR /&gt;| table title roles&lt;BR /&gt;| rename title as SAML&lt;/P&gt;
&lt;P&gt;This search has roles to indexes&lt;/P&gt;
&lt;P&gt;| rest /services/authentication/users | mvexpand roles | table roles | join roles [ rest /services/authorization/roles | rename title as roles | search srchIndexesAllowed=* | table roles srchIndexesAllowed] | rename roles as Roles, srchIndexesAllowed as "Indexes this Role has access"&lt;BR /&gt;| dedup Roles&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 18:14:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/640854#M222031</guid>
      <dc:creator>NanSplk01</dc:creator>
      <dc:date>2023-04-21T18:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to compile 3 searches into one to get the following Information: SAML Group, Splunk Role, index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/641045#M222102</link>
      <description>&lt;OL&gt;&lt;LI&gt;You forget to tell us how the combined results look like, and what logic is supposed to connect the three searches to get there.&lt;/LI&gt;&lt;LI&gt;The third search already joins the first search in a certain manner. ("title" in the first search is matched with "role".) &amp;nbsp;Why do you need the first search again?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If I take a wild guess, all that is left to do is to join the second search, again, with roles, in order to show SAML ID. &amp;nbsp;If I take the laziest route, you can do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rest /services/authentication/users
| mvexpand roles
| table roles
| join roles
    [| rest /services/authorization/roles
    | rename title as roles
    | search srchIndexesAllowed=*
    | table roles srchIndexesAllowed ]
| join
    [| rest /services/admin/SAML-groups
    | table title roles
    | rename title as SAML]
| rename roles as Roles, srchIndexesAllowed as "Indexes this Role has access"
| dedup Roles&lt;/LI-CODE&gt;&lt;P&gt;Using the entire users table merely for roles is quite wasteful. &amp;nbsp;A slightly more efficient search is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rest /services/authentication/users
| stats count by roles
| fields - count
| join roles
    [| rest /services/authorization/roles
    | rename title as roles
    | search srchIndexesAllowed=*
    | table roles srchIndexesAllowed ]
| join roles
    [| rest /services/admin/SAML-groups
    | table title roles
    | rename title as SAML]
| rename roles as Roles, srchIndexesAllowed as "Indexes this Role has access"&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Apr 2023 22:44:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/641045#M222102</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-04-22T22:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to compile 3 searches into one to get the following Information: SAML Group, Splunk Role, index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/641777#M222314</link>
      <description>&lt;P&gt;This was perfect, now I just need to combine this with Azure to get the final piece.&amp;nbsp; Appreciate the assist.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 16:41:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/641777#M222314</guid>
      <dc:creator>NanSplk01</dc:creator>
      <dc:date>2023-04-28T16:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to compile 3 searches into one to get the following Information: SAML Group, Splunk Role, index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/641790#M222317</link>
      <description>&lt;P&gt;Just realized that the search is not bringing back all the details.&amp;nbsp; There are over 200 roles in our Splunk Cloud, but not all of them are showing.&amp;nbsp; How do I get all the information.&amp;nbsp; Say there are roles that have not been attached to an index or a SAML group?&amp;nbsp; How do I get all the information?&amp;nbsp; I'm guessing I would need to be able to see those that have null values?&lt;/P&gt;&lt;P&gt;Any assist would be greatly appreciated.&amp;nbsp; Trying to get this information so that we can keep track of and verify for security that everything we have is matching up with what we expect to see.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 18:08:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/641790#M222317</guid>
      <dc:creator>NanSplk01</dc:creator>
      <dc:date>2023-04-28T18:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to compile 3 searches into one to get the following Information: SAML Group, Splunk Role, index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/641802#M222324</link>
      <description>&lt;P&gt;The reason my wild guess used authentication/users endpoint as the first of three REST search is because your original search 3 used that as the first. &amp;nbsp;As such, I speculated that your intention was to limit output to those of allocated users only.&lt;/P&gt;&lt;P&gt;Because that is not the case, the users search contributes nothing and can be dropped altogether. &amp;nbsp;If you know which search gives all roles, simply use that as the first search before performing inner join. (You can use outer join but that seems wasteful.) &amp;nbsp;Suppose&amp;nbsp;authorization/roles has the complete list, you can do something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rest /services/authorization/roles
| rename title as roles
| search srchIndexesAllowed=*
| table roles srchIndexesAllowed
| join
    [| rest /services/admin/SAML-groups
    | table title roles
    | rename title as SAML]
| rename roles as Roles, srchIndexesAllowed as "Indexes this Role has access"&lt;/LI-CODE&gt;&lt;P&gt;Yes, some rows will have null values for SAML.&lt;/P&gt;&lt;P&gt;Note the reason to use join is also because you already know join. &amp;nbsp;The general advice is to avoid join and use stats. &amp;nbsp;In your case, all searches start with rest which can only support one URI. &amp;nbsp;There is no gain to use stats.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 22:08:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/641802#M222324</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-04-28T22:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to compile 3 searches into one to get the following Information: SAML Group, Splunk Role, index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/641991#M222389</link>
      <description>&lt;P&gt;Unfortunately the null value is not being used when one of the fields doesn't match.&amp;nbsp; For instance if I have a SAML value, but it hasn't been mapped to a role yet, I would want a null value as the value for that role field.&amp;nbsp; Is that possible with the search?&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 11:54:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/641991#M222389</guid>
      <dc:creator>NanSplk01</dc:creator>
      <dc:date>2023-05-02T11:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to compile 3 searches into one to get the following Information: SAML Group, Splunk Role, index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/642088#M222423</link>
      <description>&lt;P&gt;In that case, you'll have to use left join - again, not much to be gained by using alternatives.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rest /services/authorization/roles
| rename title as roles
| search srchIndexesAllowed=*
| table roles srchIndexesAllowed
| join type=left
    [| rest /services/admin/SAML-groups
    | table title roles
    | rename title as SAML]
| rename roles as Roles, srchIndexesAllowed as "Indexes this Role has access"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 03:46:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compile-3-searches-into-one-to-get-the-following/m-p/642088#M222423</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-03T03:46:32Z</dc:date>
    </item>
  </channel>
</rss>

