Splunk Search

How to convert inline pivot expression into equivalent non-pivot search expression?

bhawkins1
Communicator

I have a pivot query that produces a one-million row table with ~50 columns. I'd like to extend the limit for that table to at least 10-million rows, but pivot tables can't do this.

To deal with the issue I'd like to convert the pivot expression into an equivalent non-pivot search expression.

To do this manually, the only solution I've thought of so far involves ~50 joins (one for each column). I'm confident that splunk has done something smarter to generate the pivot.

Is there an easy way to convert a pivot expression into a non-pivot search?

0 Karma
1 Solution

rjthibod
Champion

You can open you inline Pivot search in the Job inspector to see how Splunk translates the Pivot into other commands like tstats.

If you run the search in the UI, you should be able to click the "job inspector" icon and expand the details to see the contents of the litsearch, reportsearch, etc. fields. The non-pivot equivalent is basically those pieces put together.

View solution in original post

rjthibod
Champion

You can open you inline Pivot search in the Job inspector to see how Splunk translates the Pivot into other commands like tstats.

If you run the search in the UI, you should be able to click the "job inspector" icon and expand the details to see the contents of the litsearch, reportsearch, etc. fields. The non-pivot equivalent is basically those pieces put together.

bhawkins1
Communicator

Thanks! I can see that the pivot is working by simply appending a | sort limit=1000000 key to the end of the query. Removing or otherwise changing this should remove the limit - correct?

0 Karma

rjthibod
Champion

you will want to use sort 0 key to have unlimited results

rjthibod
Champion

Note, this suggestion is not going to be the optimal solution, but it is a solution. Having that many joins is concerning, so the optimal solution would depend on many other factors like how many datamodels are you searching, how many different datamodel objects, accelerated or not accelerated datamodels, etc.

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...