<?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 Looking to rewrite a join across several indexes with somewhat unusual relationships in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/504485#M140848</link>
    <description>&lt;P&gt;(I am reposting this question from email, with permission from the person who emailed)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I need to basically join 3 indexes where the ‘join’ info is in a 4th index. The 3 former indexes have around 50000 entries while the 4th index around 500000.&lt;BR /&gt;&lt;BR /&gt;The fields in the indexes are:&lt;/P&gt;&lt;P&gt;Indexes containing the data: Index A, B, C, …:&amp;nbsp; name status id&lt;/P&gt;&lt;P&gt;Index containing relationships:&amp;nbsp; Index REL:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id parent child&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The parent and child values in REL match the id value in A, B and C.&lt;BR /&gt;And also note that the id values in A, B and C never collide, in other words the "single id space" of the REL events has no overlaps across the entities in A, B, C&lt;/P&gt;&lt;P&gt;From A to B is normally a 1 to many relation, and from B to C is a many-to-many relation.&lt;/P&gt;&lt;P&gt;The specific use case here is that A represents Applications, B represents Deployments of those applications, and C represents Servers implementing those deployments.&lt;/P&gt;&lt;P&gt;A server can be used for several deployments hence the many-to-many relation here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The obvious way would be to do something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=A
| rename id as A_id,  name as Aname, status as Astatus
| join max=0 type=left A_id
       [ | search index=REL | rename parent as A_id, child as B_id ]
| join max=0 type=left B_id
       [ | search index=B
         | rename is as B_id, name as Bname, status as Bstatus ]
| join max=0 type=left B_id
       [ | search index=REL | rename parent as B_id, child as C_id ]
| join max=0 type=left C_id
       [ | search index=C
         | rename id as C_id, name as Cname, status as Cstatus ]
| table Aname Astatus Bname Bstatus Cname Cstatus&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This, of course, fails miserably because the join only returns 10000 results while the REL index has 400000 events…&lt;/P&gt;&lt;P&gt;I can rewrite the first join as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index IN(A REL)
| eval parent=if(index=REL, parent, id),
       child =if(index=REL, child,  id)
| stats values(name) as Aname values(statu) as Astatus  values(child) as childs
    by  parent
| table Aname Astatus childs&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I’m at a loss how to squeeze in the other indexes and relation…&lt;BR /&gt;And I also have some hope that there's a way to avoid join entirely.&lt;BR /&gt;&lt;BR /&gt;UPDATE: Here is a run-anywhere search to fabricate some sample input rows&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval data="1,A,appl1,,;2,A,appl2,,;3,D,depl1,,;4,D,depl2,,;5,D,depl3,,;6,S,serv1,,;7,S,serv2,,;8,S,serv3,,;9,S,serv4,,;10,R,,1,3;11,R,,2,4;12,R,,2,5;13,R,,3,6;14,R,,4,7;15,R,,5,8;16,R,,5,9",
     data=split(data, ";")
| mvexpand data
| rex field=data "(?&amp;lt;sys_id&amp;gt;[^,]*),(?&amp;lt;type&amp;gt;[^,]*),(?&amp;lt;name&amp;gt;[^,]*),(?&amp;lt;parent&amp;gt;[^,]*),(?&amp;lt;child&amp;gt;[^,]*)"
| fields sys_id type name parent child
| eval parent=if(parent=="",null(),parent), child=if(child=="",null(),child)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;And the desired output,&amp;nbsp; is rows that map app1 to depl1 and serv1&amp;nbsp;&amp;nbsp; and that map app2 to depl2,depl3 and serv2,serv3,serv4&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jun 2020 23:42:34 GMT</pubDate>
    <dc:creator>sideview</dc:creator>
    <dc:date>2020-06-16T23:42:34Z</dc:date>
    <item>
      <title>Looking to rewrite a join across several indexes with somewhat unusual relationships</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/504485#M140848</link>
      <description>&lt;P&gt;(I am reposting this question from email, with permission from the person who emailed)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I need to basically join 3 indexes where the ‘join’ info is in a 4th index. The 3 former indexes have around 50000 entries while the 4th index around 500000.&lt;BR /&gt;&lt;BR /&gt;The fields in the indexes are:&lt;/P&gt;&lt;P&gt;Indexes containing the data: Index A, B, C, …:&amp;nbsp; name status id&lt;/P&gt;&lt;P&gt;Index containing relationships:&amp;nbsp; Index REL:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id parent child&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The parent and child values in REL match the id value in A, B and C.&lt;BR /&gt;And also note that the id values in A, B and C never collide, in other words the "single id space" of the REL events has no overlaps across the entities in A, B, C&lt;/P&gt;&lt;P&gt;From A to B is normally a 1 to many relation, and from B to C is a many-to-many relation.&lt;/P&gt;&lt;P&gt;The specific use case here is that A represents Applications, B represents Deployments of those applications, and C represents Servers implementing those deployments.&lt;/P&gt;&lt;P&gt;A server can be used for several deployments hence the many-to-many relation here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The obvious way would be to do something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=A
| rename id as A_id,  name as Aname, status as Astatus
| join max=0 type=left A_id
       [ | search index=REL | rename parent as A_id, child as B_id ]
| join max=0 type=left B_id
       [ | search index=B
         | rename is as B_id, name as Bname, status as Bstatus ]
| join max=0 type=left B_id
       [ | search index=REL | rename parent as B_id, child as C_id ]
| join max=0 type=left C_id
       [ | search index=C
         | rename id as C_id, name as Cname, status as Cstatus ]
| table Aname Astatus Bname Bstatus Cname Cstatus&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This, of course, fails miserably because the join only returns 10000 results while the REL index has 400000 events…&lt;/P&gt;&lt;P&gt;I can rewrite the first join as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index IN(A REL)
| eval parent=if(index=REL, parent, id),
       child =if(index=REL, child,  id)
| stats values(name) as Aname values(statu) as Astatus  values(child) as childs
    by  parent
| table Aname Astatus childs&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I’m at a loss how to squeeze in the other indexes and relation…&lt;BR /&gt;And I also have some hope that there's a way to avoid join entirely.&lt;BR /&gt;&lt;BR /&gt;UPDATE: Here is a run-anywhere search to fabricate some sample input rows&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval data="1,A,appl1,,;2,A,appl2,,;3,D,depl1,,;4,D,depl2,,;5,D,depl3,,;6,S,serv1,,;7,S,serv2,,;8,S,serv3,,;9,S,serv4,,;10,R,,1,3;11,R,,2,4;12,R,,2,5;13,R,,3,6;14,R,,4,7;15,R,,5,8;16,R,,5,9",
     data=split(data, ";")
| mvexpand data
| rex field=data "(?&amp;lt;sys_id&amp;gt;[^,]*),(?&amp;lt;type&amp;gt;[^,]*),(?&amp;lt;name&amp;gt;[^,]*),(?&amp;lt;parent&amp;gt;[^,]*),(?&amp;lt;child&amp;gt;[^,]*)"
| fields sys_id type name parent child
| eval parent=if(parent=="",null(),parent), child=if(child=="",null(),child)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;And the desired output,&amp;nbsp; is rows that map app1 to depl1 and serv1&amp;nbsp;&amp;nbsp; and that map app2 to depl2,depl3 and serv2,serv3,serv4&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 23:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/504485#M140848</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2020-06-16T23:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to rewrite a join across several indexes with somewhat unusual relationships</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/504486#M140849</link>
      <description>&lt;DIV&gt;One solution would be if we could shift the deployment stuff over onto the application rows, &amp;nbsp;and you need to shift the server stuff over as well.&amp;nbsp; Or going the other way, if we could shift all the pieces we need ontot he actual "relationship" rows, and then just do a stats that only picks things up from them.&lt;BR /&gt;&lt;BR /&gt;Either way - that sort of feeling, where you need to copy a couple phases of things around using different ids,&amp;nbsp; is when you should think of eventstats or streamstats.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;In this particular case I cannot make it very simple.&amp;nbsp;&amp;nbsp; It involves a lot of "shifts" and it's ugly.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval data="1,A,appl1,,;2,A,appl2,,;3,D,depl1,,;4,D,depl2,,;5,D,depl3,,;6,S,serv1,,;7,S,serv2,,;8,S,serv3,,;9,S,serv4,,;10,R,,1,3;11,R,,2,4;12,R,,2,5;13,R,,3,6;14,R,,4,7;15,R,,5,8;16,R,,5,9",
     data=split(data, ";")
| mvexpand data
| rex field=data "(?&amp;lt;sys_id&amp;gt;[^,]*),(?&amp;lt;type&amp;gt;[^,]*),(?&amp;lt;name&amp;gt;[^,]*),(?&amp;lt;parent&amp;gt;[^,]*),(?&amp;lt;child&amp;gt;[^,]*)"
| fields sys_id type name parent child
| eval parent=if(parent=="",null(),parent), child=if(child=="",null(),child)

| eval application_id=case(type="A",sys_id, type="R",parent),
       server_id=case(type=="S",sys_id,type="R",child),
       application_name=case(type="A",name),
       deployment_name=case(type="D",name),
       server_name = case(type="S",name)
| eventstats values(server_name) as server_name by server_id
| eval deployment_id=case(type=="D",sys_id,type=="R" AND isnull(server_name), child, true(),parent)
| eventstats values(server_id) as server_id values(deployment_id) as deployment_id by application_id
| fillnull deployment_id value=""
| mvexpand deployment_id
| eventstats values(deployment_name) as deployment_name values(server_name) as server_name by deployment_id
| eventstats values(application_name) as application_name by application_id
| fields application_name deployment_name server_name
| stats values(*) as * by application_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The mocked up rows -- I had to add an extra eval to try and make it a little more like data.&amp;nbsp;&amp;nbsp; emptystring values and null() values are pretty different.&amp;nbsp;&amp;nbsp; I manually am turning some thing sback into null() values where it matters.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;The big eval statement -- it's a little careless in how it hands out application_id but it doesnt matter - likewise with server_id&lt;/DIV&gt;&lt;DIV&gt;the next two lines - eventstats and then the eval that makes deployment_id -&amp;nbsp;&amp;nbsp; deployment id is trickier but we basically use the absence of the server_name field to conclude that the "R" row is a application-to-deployment row.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;the fillnull - mvexpand will throw away values that are actual nulls, so we do an ugly workaround to replace with emptystring values.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It's a bit of a shell game.&amp;nbsp; It copies the data from row to row,&amp;nbsp; step by step.&amp;nbsp; tedious and painful.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;And if there's a way to replace it all with a simple pair of stats commands,&amp;nbsp; it's certainly beyond my abilities at the moment.&lt;BR /&gt;&lt;BR /&gt;SO - there's another path.&amp;nbsp; And that's to break it into smaller problems.&lt;/DIV&gt;&lt;DIV&gt;I would go that way in this case.&amp;nbsp;&amp;nbsp; Make a static file-based lookup mapping deployment id to deployment name.&lt;/DIV&gt;&lt;DIV&gt;likewise from server id to server name.&amp;nbsp;&amp;nbsp; and from application id to application name.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Then you can have 3 explicit lookup statements, painting these names onto all the rows.&amp;nbsp; And between eval and lookup you can actually load up the "relationship" rows with ALL of the ids and names,&amp;nbsp; and then one simple stats can do it in a single fell swoop then.&amp;nbsp; I'll come back and write up specific SPL to flesh out this way.&lt;/DIV&gt;</description>
      <pubDate>Wed, 17 Jun 2020 00:13:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/504486#M140849</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2020-06-17T00:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to rewrite a join across several indexes with somewhat unusual relationships</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/505273#M141187</link>
      <description>&lt;P&gt;I see this as a nontrivial version of Splunk soup.&amp;nbsp; I'd proceed like this...&lt;/P&gt;&lt;LI-CODE lang="css"&gt;index=A OR index=REL or index=B OR index=C
| fields index parent child name status id


| rename COMMENT as "double the REL records, levaing the others single"
| eval myfan=mvrange(0,if(index="REL",2,1))
| mvexpand myfan

| rename COMMENT as "set up match keys and data fields"
| eval A_id=case(index="A",id, index="REL" AND myfan=0,parent)
| eval B_id=case(index="B",id, index="REL" AND myfan=0,child, index="REL" AND myfan=1,parent)
| eval C_id=case(index="C",id, index="REL" AND myfan=1,child)
| eval A_name=case(index="A",name)
| eval A_status=case(index="A",status)
| eval B_name_status=case(index="B",name."!!!!".status)
| eval C_name_status=case(index="C",name."!!!!".status)
&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;At this point records look like this&lt;/P&gt;&lt;LI-CODE lang="css"&gt;index=A id name status A_id A_name A_status
index=B id name status B_id B_name_status
index=C id name status C_id C_name_status

index=REL myfan=0 parent child A_id B_id
index=REL myfan=1 parent child B_id C_id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I'd proceed like this...&lt;/P&gt;&lt;LI-CODE lang="css"&gt;| rename COMMENT as "reduce to required fields with one of these two"
| fields - id name status parent child
| fields index myfan A_id A_name A_status B_id B_name_status C_id C_name_status

| rename COMMENT as "roll data from REL myfan 0 to A, then myfan=1 to A, tehn drop REL"
| eventstats values(eval(case(myfan=0,B_id)) as B_id by A_id
| eventstats values(eval(case(myfan=1,C_id)) as C_id by B_id
| where index!="REL"

| rename COMMENT as "now we have only A, B, C records, and the A records have all relevant keys."
| rename COMMENT as "Roll B record to A then drop B"
| eventstats values(B_name_status) as B_name_status by B_id
| where index!="B"

| rename COMMENT as "Roll C record to A then drop C"
| eventstats values(C_name_status) as C_name_status by C_id
| where index!="C"
| rename COMMENT as "Above could be a stats"

| rename COMMENT as "Add placeholders to handle potential NULLS"
| eval B_name_status=coalesce(B_name_status,"N/A!!!!N/A")
| eval C_name_status=coalesce(C_name_status,"N/A!!!!N/A")

| rename COMMENT as "split up the records, then the fields"
| mvexpand C_name_status
| mvexpand B_name_status
| eval B_name=mvindex(split(B_name_status,"!!!!"),0)
| eval B_status=mvindex(split(B_name_status,"!!!!"),1)
| eval C_name=mvindex(split(C_name_status,"!!!!"),0)
| eval C_status=mvindex(split(C_name_status,"!!!!"),1)

| rename COMMENT as "drop unneeded fields"
| table A_name A_status B_name B_status C_name C_status&lt;/LI-CODE&gt;&lt;P&gt;That's all air code, so you'd have to shake it down with a small subset of the records before running the whole data set.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2020 20:15:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/505273#M141187</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-06-19T20:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to rewrite a join across several indexes with somewhat unusual relationships</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/505350#M141217</link>
      <description>&lt;P&gt;Heads up: mvexpand has &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Mvexpand#Limits" target="_self"&gt;limits&lt;/A&gt;&amp;nbsp;you might run into in this scenario:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jeffland_0-1592676936419.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9266i35F289C4D1AAEA60/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jeffland_0-1592676936419.png" alt="jeffland_0-1592676936419.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 18:16:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/505350#M141217</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2020-06-20T18:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to rewrite a join across several indexes with somewhat unusual relationships</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/505524#M141274</link>
      <description>&lt;P&gt;(I'm the person that originally emailed the question to sideview.)&lt;/P&gt;&lt;P&gt;Thanks all for the good discussion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did do an implementation using lookup tables. It looks much simpler but you depend on creating the lookups in the first place:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=A ...
| outputlookup A.csv&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;before combining the data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup A.csv
| rename id as A_id, name as A_name

| lookup REL.csv parent as A_id output child as B_id
| where isnotnull(B_id)
| mvexpand B_id

| lookup B.csv id as B_id output name as B_name
| where isnotnull(B_name)

| lookup REL.csv parent as B_id output child as C_id
| where isnotnull(C_id)
| mvexpand C_id

| lookup C.csv id as C_id output name as C_name
| mvexpand C_name

| fields - A_id B_id C_id
| sort  0 A_name B_name C_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although it&amp;nbsp; duplicates possibly a lot of data, this seems easier to understand and to extend to&amp;nbsp; even more relationships.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 15:09:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/505524#M141274</guid>
      <dc:creator>mmol</dc:creator>
      <dc:date>2020-06-22T15:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to rewrite a join across several indexes with somewhat unusual relationships</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/506364#M141675</link>
      <description>&lt;P&gt;Simple to understand and simple to support are good decisions.&lt;/P&gt;&lt;P&gt;Well done.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 21:37:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Looking-to-rewrite-a-join-across-several-indexes-with-somewhat/m-p/506364#M141675</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-06-26T21:37:12Z</dc:date>
    </item>
  </channel>
</rss>

