All Apps and Add-ons

Why is the REST API modular input response xml data charset is broken?

Path Finder

i have a problem with the character set.

I am using the REST API modular input.
However, characters are broken in the xml data received in response through the REST API.
like this:

<?xml version="1.0" encoding="UTF-8"?>
<![CDATA[ìœ ì˜ë¯¸ì˜ 마음은 ì–¸ì œë‚˜ 청춘]]>

I tried this thing:

  1. modify props.conf


  2. modify

    coding: utf-8
    import sys

    import json
    import datetime

    class MyResponseHandler:

    def __init__(self,**args):
    def __call__(self, response_object,raw_response_output,response_type,req_args,endpoint):
        cookies = response_object.cookies
        if cookies:
            req_args["cookies"] = cookies

    what should I do?

0 Karma

Splunk Employee
Splunk Employee

It seems like your broken text is encoded with iso-8859-1(Latin1). Is the first line of your "coding: utf-8" just a typo? It should be something like "#-- coding: utf-8 --".

0 Karma

Path Finder

that is a typo.
splunk answer comment form automatically change that String.

i write like this :
"# -- coding : utf-8 --"

but, that is broken yet.

  • my python version is 2.7.x
0 Karma
Get Updates on the Splunk Community!

Splunk Forwarders and Forced Time Based Load Balancing

Splunk customers use universal forwarders to collect and send data to Splunk. A universal forwarder can send ...

NEW! Log Views in Splunk Observability Dashboards Gives Context From a Single Page

Today, Splunk Observability releases log views, a new feature for users to add their logs data from Splunk Log ...

Last Chance to Submit Your Paper For BSides Splunk - Deadline is August 12th!

Hello everyone! Don't wait to submit - The deadline is August 12th! We have truly missed the community so ...