Splunk Search

Create an Own column in my query

exchanger
Path Finder

Hello,

I have a query (e.g. "....... " | stats count, avg(...)) and after that I get as result
Count avg
20        40

What I would like to have before that is a separate column that I can name myself.
So desired:
OwnColumn Count AVG
XYZ                 20           40

How can I include this in my query?

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| stats count as Count, avg(DURATION)) as AVG
| eval OwnColumn="XYZ"
| fields OwnColumn, Count, AVG

View solution in original post

exchanger
Path Finder

thank you very much

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| stats count as Count, avg(DURATION)) as AVG
| eval OwnColumn="XYZ"
| fields OwnColumn, Count, AVG
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...