Splunk Search

Why am I receiving fewer events when using rename command in Splunk?

vjsplunk
Loves-to-Learn Everything

I am getting fewer events when using rename command in splunk. ( Compared to the search where I haven't used rename). What could be the reason behind this?

0 Karma

vjsplunk
Loves-to-Learn Everything

Without rename:

index="A"  sourcetype="B"
| stats values(project_name2), count(linecount) by pod
| sort - count(linecount) | head 10

With rename:

index="A"  sourcetype="B"

| stats values(project_name2) as project count(linecount) as lines by pod
| sort - count(linecount) | head 10

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @vjsplunk,

the reason is that in the second case you don't have more ths field "count(linecount)" but the field "lines", so when you sort you have few events, please try this:

index="A"  sourcetype="B"
| stats values(project_name2) AS project count(linecount) AS lines BY pod
| sort -lines 
| head 10

Ciao.

Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @vjsplunk,

could you share your searches (with and without rename)?

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...