For java sdk, output mode as json, I am getting fields sent from splunk and their values as json. But how ever is the order of fields in the table statement
| table field1, field2
| table field2, field1
The order of fields I get in the java side is the same - and i need the order the same way as I has specified in the query after table
What should be done to get this way
It should honor the fields specified in the query string after the table keyword. If possible, try to run the query through cURL and see whether you get the desired results. Nonetheless, you can pass the list of fields explicitly to the getResults method on the job, once its done.