Document toolboxDocument toolbox

pathFromRoot

Given data of chain events find the path (chain of processes) from root to the current event.

Let us say that we have following chain of events:

parent_process child_process
AB
BC
CD
AE
BF

which looks as follow:

Graph

A
       / \
      B   E
     / \       
    C   F
   /
  D

and for each row we want to get chain sequence all the way from root, example, as follow:

parent_process child_process lhub_path
ABA->B
BCA->B->C
CDA->B->C->D
AEA->E
BFA->B->F

also add additional information such as what is the depth of the step (distance from root process), and is it leaf step (final process)

Operator Usage in Easy Mode

  1. Click + on the parent node.
  2. Enter the Path from Root operator in the search field and select the operator from the Results to open the operator form.
  3. In the Table drop-down, enter or select the table to which the operator is applied.
  4. In the Source Attribute drop-down, enter or select the list of columns that define the source.
  5. In the Dest Attribute drop-down, enter or select the list of columns that define the destination.
  6. Optional. In the Max Depth, click Add More to add the maximum depth of the graph. You can click to add more to define the maximum depth of the graph.
  7. Click Run to view the result.
  8. Click Save to add the operator to the playbook.
  9. Click Cancel to discard the operator form.

Usage Details

```scala LQL Command pathFromRoot(table, sourceAttributes, destAttributes, maxDepth) // table: input table to apply the operator // sourceAttributes: list of column names that specify the source e.g. ["computerName", "sourceProcessID", "sourceProcessName"] // destAttributes: list of column names that specify the dest e.g. ["computerName", "destProcessID", "dstProcessName"] // maxDepth: optional parameter to help to reduce computation time, if you know in advance approximate maxDepth of the tree, the set the value and it will compute up to that level, otherwise it might run into loops and compute forever.

## Example

**Input**  
table

<style>
  th {
    border: 1px solid #cccccc;
    background-color: #eeeeee;
    padding: 8px 5px 8px 5px;
    text-align: left
  }
</style>
<div><table>
<thead>
<tr>
<th>parent_process</th>
<th>child_process</th>
</tr>
</thead>
<tbody>
<tr><td>A</td><td>B</td></tr>
  <tr><td>B</td><td>C</td></tr>
  <tr><td>C</td><td>D</td></tr>
  <tr><td>A</td><td>E</td></tr>
  <tr><td>B</td><td>F</td></tr>
</tbody>
</tr>
</table></div>

LQL command
``` {sql}
pathFromRoot(table, ["partent_process"], ["child_process"])

Output

parent_process child_process lhub_path lhub_isLeaf lhub_level lhub_root
ABA=>B01A
BCA=>B=>C02A
CDA=>B=>C=>D13A
AEA=>E11A
BFA=>B=>F12A