Splunk Search

What is the meaning of the following statement?

sbgoldberg13
Explorer

In the following search:

index=_internal source=*metrics.log group="per_host_thruput" | eval GB=kb/1048576 | stats sum(GB) as total by series | addinfo | eval days = (info_max_time - info_min_time) / 86400 | fields - info* | eval daily_average = total / days

What does the "fields - info*" do?

Thanks.

Tags (2)
0 Karma
1 Solution

harsmarvania57
Ultra Champion

Hi,

It will remove all fields starting with info from results. When you use | addinfo command it will add info_max_time, info_min_time, info_search_time and info_sid fields. So when you add | fields - info* it will remove all these fields from results.

View solution in original post

0 Karma

somesoni2
Revered Legend

Your query before the | addinfo command calculates the amount of data sent by each host in GB. The | addinfo adds many info* fields in the search which includes the time range (the info_min_time i.e. earliest and info_max_time i.e. latest). You're using those time range epoch valued fields to get number of days in your time range. Once the number of days are calculate, you're removing those info* fields as you don't want to show them, by using | fields - info*.

0 Karma

sbgoldberg13
Explorer

Thanks...!

0 Karma

harsmarvania57
Ultra Champion

Hi,

It will remove all fields starting with info from results. When you use | addinfo command it will add info_max_time, info_min_time, info_search_time and info_sid fields. So when you add | fields - info* it will remove all these fields from results.

0 Karma

sbgoldberg13
Explorer

Thanks. That makes sense. 🙂

0 Karma
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...