Splunk Search

Splunk query issue

santosh11
New Member

Dear All,

I have two columns Id and relationalId below is the sample of it.

Id CorrelationalId
1 2

2 3

3 4

i am looking to get as an output

RelatedCorrelationalId

1 2 3 4

Please can someone guide me on the above issue.

Regards,
Santosh

0 Karma

493669
Super Champion

@santosh11 Try below query-

| eval RelatedCorrelationalId = mvappend(Id, CorrelationalId)| stats count by RelatedCorrelationalId | table RelatedCorrelationalId

Below is using sample data-

|makeresults|eval Id="1", CorrelationalId="2"
|append[|makeresults|eval Id="2", CorrelationalId="3"]
|append[|makeresults|eval Id="3", CorrelationalId="4"]
|fields - _time| eval RelatedCorrelationalId = mvappend(Id, CorrelationalId)| stats count by RelatedCorrelationalId | table RelatedCorrelationalId

Let me know if it helps!

0 Karma

santosh11
New Member

I am trying that now will update you on the status. Thank you for the response.

0 Karma

493669
Super Champion

Can you explain How RelatedCorelationalId field is getting populated?

0 Karma

santosh11
New Member

Sorry for the inproper information.

Basically the RelatedCorrelationId is my required Output.

Where i need to get all the interlinked records of Id and corelationalId. Basically parent child relationship. i need to get all that records in one place.

Hope it explains.

Regards,
Santosh

0 Karma
Get Updates on the Splunk Community!

Federated Search for Amazon S3 | Key Use Cases to Streamline Compliance Workflows

Modern business operations are supported by data compliance. As regulations evolve, organizations must ...

New Dates, New City: Save the Date for .conf25!

Wake up, babe! New .conf25 dates AND location just dropped!! That's right, this year, .conf25 is taking place ...

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud  In today’s fast-paced digital ...