Splunk Search

How to add extracted fields name as first column value

techytanzy
Explorer

Hello Splunk Gurus,

I am trying to generate tabular data for the API requests.

Following is the query to extract below table data

The FirstComp, SecondComp and ThirdComp are fields extracted at run time from log.

index=micro host=app150*usa.com "API Timeline" |
rex field=_raw "FirstCompTime:(?<FirstComp>[^\,]+)" |
rex field=_raw "SecondCompTime:(?<SecondComp>[^\,]+)" |
rex field=_raw "ThirdCompTime:(?<ThirdComp>[^\,]+)" | table FirstComp, SecondComp, ThirdComp

FirstCompSecondCompThirdComp
782531
802234
812636

 

Now I need to calculate the 95th and 99th percentile and making sure components name appear as part of first column as shown  below-

Components95th percentile99th percentile
FirstComp7779
SecondComp2324
ThirdComp3235

 

The desired output should show 99th percentile & 95th percentile by different component id.

So eventually i want to bring column headers name as part of first column's value and next two column should have respective 99th percentile & 95th percentile.

Thanks in advance for your time and help.

Tanzy

Labels (2)
0 Karma

techytanzy
Explorer

Any idea @niketn ?

0 Karma

venkatasri
SplunkTrust
SplunkTrust

Hi @techytanzy 

What's your expected output table format?

0 Karma

techytanzy
Explorer

Hi @venkatasri ,

   Pardon me for not providing proper request. Updated the post. Hope its clear on requirement.

Thanks

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...