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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

New This Month - Observability Updates Give Extended Visibility and Improve User ...

This month is a collection of special news! From Magic Quadrant updates to AppDynamics integrations to ...

Intro to Splunk Synthetic Monitoring

In our last post, we mentioned that the 3 key pieces of observability – metrics, logs, and traces – provide ...