Splunk Search

Is there a way to determine if Splunk results will return in tabular format or raw events format?

kunal0311
New Member

Hi All,
I have a requirement to email Splunk results. The problem is some Splunk results are in table format and some are in raw format. How can i determine if the resultset returned is tabular or unformatted raw format? How can i do that using Splunk SDK?

0 Karma

dstile
Explorer

If you haven't already, maybe check out this example:
https://github.com/splunk/splunk-sdk-java/blob/master/examples/com/splunk/examples/search/Program.ja...

Look at line 103. Couldn't you do something similar to test if there are results in the OutputList array and if not, format as events?

0 Karma

hunters_splunk
Splunk Employee
Splunk Employee

Hi kunal0311,

Simply put:

Hope this helps. Thank!
Hunter

0 Karma

kunal0311
New Member

Thanks for the response. It was helpful. What i was actually looking for was that is there a way in Java using Splunk SDK to pro grammatically check the Events and identify whether the resultset from splunk is raw or formatted.

0 Karma

lguinn2
Legend

If you have transformed the data in any way, the search pipeline will return a table, not the raw events.
If all you have done is filtered the events using search and where commands, then your search will return raw events.

If you want to know which commands transform the data, you might want to start with Types of Commands in the Search Manual.

HTH

0 Karma

kunal0311
New Member

Thanks for the response. It was helpful. What i was actually looking for was that is there a way in Java using Splunk SDK to pro grammatically check the Events and identify whether the resultset from splunk is raw or formatted.

0 Karma
Get Updates on the Splunk Community!

How to Monitor Google Kubernetes Engine (GKE)

We’ve looked at how to integrate Kubernetes environments with Splunk Observability Cloud, but what about ...

Index This | How can you make 45 using only 4?

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

Splunk Education Goes to Washington | Splunk GovSummit 2024

If you’re in the Washington, D.C. area, this is your opportunity to take your career and Splunk skills to the ...