Splunk Dev

Splunk SDK custom command iterate records in order

joshiro
Communicator

We re trying to iterate results rows and columns in the same order as the table before the custom command, the 'records' object in the custom command code iterates in order by row, but changes the order of the columns.

 

def reduce(self, records):
    for record in records:
        yield record

 

This example of the reduce method of a ReportingCommand prints the results in a different column order than the original search.

We need to iterate 'records' in the same order of rows and columns. Any ideas?


Labels (2)
0 Karma
Get Updates on the Splunk Community!

Enhance Your Splunk App Development: New Tools & Support

UCC FrameworkAdd-on Builder has been around for quite some time. It helps build Splunk apps faster, but it ...

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

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