Splunk Search

corrupted CSV results / Python API

tomasv
Explorer

Hi,

I'm using the Python SDK to export some search results to a CSV file, but the results seem to be somehow corrupted unless I specify an exact list of fields. So for example this:

index=myindex field=pattern

produces corrupted results but this

index=myindex field=pattern | table field_a, field_b

works just fine. The corruption looks a bit like a randomly scattered newline characters - the line suddenly ends (in the middle of a field), then there's a part of the original line missing and the remainder is on the next line. (or something like that, I'm not sure what is the exact corruption).

The data do not contain newline characters - when exporting to JSON everything is peachy. Also there are no mixed Windows/Unix line ends (I'm on Linux).

wcolgate_splunk
Splunk Employee
Splunk Employee

Question: I've seen JSON output and it appears to have "nice-afied" the "\n" new lines. Could you capture a CSV and XML portion and send to devinfo@splunk.com?

Thanks,

Wim

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...