Skip to content

Commit e897436

Browse files
author
David Noble
committed
We are no longer sorting fields on output
The splunklib.searchcommands customer now controls the order of fields in the output stream.
1 parent dab6fab commit e897436

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

splunklib/searchcommands/splunk_csv/dict_writer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def _to_string(item):
8181

8282
def _writeheader(self, record):
8383
if self.fieldnames is None:
84-
self.fieldnames = sorted(record.keys())
84+
self.fieldnames = record.keys()
8585
self.writeheader()
8686

8787
def _writerow(self, record):
@@ -93,7 +93,8 @@ def _writerow(self, record):
9393
if isinstance(value, list):
9494
value, multi_value = self._encode_list(value)
9595
row[fieldname] = value
96-
row['__mv_' + fieldname] = multi_value
96+
if multi_value is not None:
97+
row['__mv_' + fieldname] = multi_value
9798
elif isinstance(value, bool):
9899
row[fieldname] = int(value)
99100
else:

0 commit comments

Comments
 (0)