Splunk Enterprise Security

Submit and Extract xml data

avivz
New Member

Hi, I submitted a xml string to specific index using (.submit()) in python.

 index = splunk_client.indexes[index_name]
 index.submit(attack, source=source, sourcetype=uuid, **params)

Then,I tried to extract the data using

kwargs_oneshot = {"count": 0}
query = r"search index="stream_buffer""
    try:

        oneshotsearch_results = splunk_client.jobs.oneshot(query, **kwargs_oneshot)
        query_results = results.ResultsReader(oneshotsearch_results)
        results_list = [result for result in query_results]
    except (ValueError, HTTPError):
        pass
    return results_list

A 166 elements list returned -with the uploaded data- but not in the correct order - so I can't use the returned data.
How can I get the result in the correct order?

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...