I want to calculate the sum of count value in a tree form of data
Count table:
http://i60.tinypic.com/2qs1bmf.png
In count table,
0.0 is child of 0,
0.0.1 is child of 0.0,
0.0.1.1 is child of 0.0.1,
0.0.2 is child of 0.0,
0.0.1.2 is child of 0.0.1,
0.0.2.1 is child of 0.0.2,
0.0.2.2 is child of 0.0.2
Total count of the node = "sum of all offspring's count"+ self count
Expected result:
http://i58.tinypic.com/vfy3oi.png
I think that I may build up the [Relationship] table first.
Like this: http://i57.tinypic.com/dd83o.png
In SQL, I can write:
SELECT child.id SEQUENCE_ID,parent.id ELDER_GENERATION_SEQUENCE_ID FROM [count_table] child
INNER JOIN [count_table] parent on (child.id like parent.id + '%')
But how about in Splunk??
After having this table, I will group by the second column of [Relationship] table and sum them up.
What is the query to do this?
Thank you!!!!!
... View more