Splunk Search

How to dynamically create a field for each API with eventstats?

philip_102uk
Engager

I have an index with several API calls and I would like to dynamically create a field for each API which can then be used to create a timechart for each API call. My query looks like this:

| bucket span=1s _time | eventstats count AS TPS by _time

I want to have a TPS (transactions per second) for each API call, so TPS_api_pathsuffix where api_pathsuffix is the pathsuffix of each API. So effectively I want to have for each API call a table with all the TPSs for that API.

I would really appreciate any help you can give me.

0 Karma
1 Solution

sundareshr
Legend

Try this

| bucket span=1s _time | eventstats count AS TPS_api_pathsuffix by _time api_pathsuffix 

View solution in original post

sundareshr
Legend

Try this

| bucket span=1s _time | eventstats count AS TPS_api_pathsuffix by _time api_pathsuffix 

philip_102uk
Engager

Hi sundareshr,

I don't see how this is going to help me, can you please explain?

0 Karma

philip_102uk
Engager

Actually, having tested the proposed solution it seems to be working. I will continue testing and then accept it as the answer if it solves the problem.

0 Karma

philip_102uk
Engager

Thank you sundareshr, this has worked.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...