Reporting

Can JAVA SDK export search return results for a non-transforming search?

lyndac
Contributor

I am trying to export data from my spunk index using the export search in the Splunk java SDK. My search is trying to get an hours worth of data, changing up some of the field names and adding a new field.

index=foo | eval  id=identifier | rex field=bar "(?<city>.+") | eval id = "GREEN"

From the SDK documentation, it says that the export search returns Results for transforming searchs and Events for non-transforming searches. But I really need to get the results from my search even though it is not technically a transforming search. Is there anyway to force the export search to return the results?

0 Karma

micahkemp
Champion

I'm going to assume that "return results instead of events" means that you don't want _raw, but instead just specific fields in table form.

To force that type of output, you can simply use table:

index=foo | eval  id=identifier | rex field=bar "(?<city>.+") | eval id = "GREEN" | table id city

Obviously the fields in that example aren't probably what you want, but that should show what I mean.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...