Splunk Search

Build a parent child relation

bharathkumarnec
Contributor

Hi All,

Below is my situation:

parentkey childkey

b c
0 a
a b
b d
b e

Output is to be like this 0-->a-->b-->c,d,e

How can i achieve this in splunk??

TIA

Regards,
BK

0 Karma
1 Solution

Sukisen1981
Champion

|stats values(childkey) by parentkey |rename values(childkey) as chld | mvexpand chld

View solution in original post

0 Karma

Sukisen1981
Champion

|stats values(childkey) by parentkey |rename values(childkey) as chld | mvexpand chld

0 Karma

bharathkumarnec
Contributor

this is valid only when we have a parent and children, but in my case i have grand children as well...

0 Karma

Sukisen1981
Champion

hi @bharathkumarnec
in that case ,can you please provide a clearer description of the 'grandchildren' and a more exact requirement?
both @mayurr98 and my answers were based on what you posted in the question.

0 Karma

mayurr98
Super Champion

try this ?

| stats values(childkey) as childkey by parentkey
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...