Skip to content

UTF-8 Encode/Decode Error Handling #505

Closed
@ashurack

Description

@ashurack

Describe the bug
Custom search commands exception out when non UTF-8 event data is present in the search pipeline

To Reproduce

  1. Create a custom command
  2. Pass non UTF-8 field data to the custom command (feel free to use invalid_utf8.csv)

Expected behavior
splunk-sdk-python (and all other potentially impacted SDK's) should handle encoding/decoding in the same manner as Splunk Core.

Logs or Screenshots

Splunk (please complete the following information):

  • Version: 8.2.5
  • OS: Windows 10 Pro 19045.2486
  • Deployment: single-instance

SDK (please complete the following information):

  • Version: 1.7.2
  • Language Runtime Version: Python 3.7
  • OS: Windows 10 Pro 19045.2486

Additional context
My patch - to get my command working ASAP - was to change errors='strict' to errors='replace' here. I chose replace since it mimic's the functionality of Splunk. I didn't touch any other instances of errors='strict' and only tested this against StreamingCommand.

This bug is not limited to the inputlookup command but it is the easiest way to reproduce.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions