I have an lookup file: (parts.csv)
partid, parentpartid
part01,
part02,part01
part03,part01
part04,part02
I need to join this data with this data: (mysearch)
day, partid, partevent, count
9/30/2013,part02,creation,23
9/30/2013,part04,update,30
Selfjoin does not appear to work as described (what little description exists). Here is my first hack attempt:
(my search) | join type=left parentpartid overwrite=f [|inputlookup parts.csv|rename parentpartid as parentpartid_lvl1|rename partid as parentpartid]
| join type=left parentpartid_lvl1 overwrite=f [|inputlookup parts.csv|rename parentpartid as parentpartid_lvl2|rename partid as parentpartid_lvl1]
| join type=left parentpartid_lvl2 overwrite=f [|inputlookup parts.csv|rename parentpartid as parentpartid_lvl3|rename partid as parentpartid_lvl2]
| join type=left parentpartid_lvl3 overwrite=f [|inputlookup parts.csv|rename parentpartid as parentpartid_lvl4|rename partid as parentpartid_lvl3]
I can then filter the results by using this statement:
| where parentpartid=tmp_partid OR parentpartid_lvl1=tmp_partid OR parentpartid_lvl2=tmp_partid OR parentpartid_lvl3=tmp_partid OR parentpartid_lvl4=tmp_partid
Note: I put my initial part id into my search by doing this as part of (mysearch): "| eval tmp_partid=part02"
I need to be able to do this up to around 40 times (maybe more), but I'm happy to put a cap on it. Any guidance or recommendation on creating a custom join or inputlookup.
... View more