Skip to content

[BUG] Issue with S2S output mode and lines over 120 char #392

Open

Description

Describe the bug
Exception in thread OutputThread0:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.7/site-packages/splunk_eventgen/eventgen_core.py", line 318, in _worker_do_work
raise e
File "/usr/local/lib/python3.7/site-packages/splunk_eventgen/eventgen_core.py", line 304, in _worker_do_work
item.run()
File "/usr/local/lib/python3.7/site-packages/splunk_eventgen/lib/outputplugin.py", line 39, in run
self.flush(self.events)
File "/usr/local/lib/python3.7/site-packages/splunk_eventgen/lib/plugins/output/s2s.py", line 204, in flush
m["_time"],
File "/usr/local/lib/python3.7/site-packages/splunk_eventgen/lib/plugins/output/s2s.py", line 173, in send_event
e = self._encode_event(index, host, source, sourcetype, _raw, _time)
File "/usr/local/lib/python3.7/site-packages/splunk_eventgen/lib/plugins/output/s2s.py", line 124, in _encode_event
encoded_raw = self._encode_key_value("_raw", _raw)
File "/usr/local/lib/python3.7/site-packages/splunk_eventgen/lib/plugins/output/s2s.py", line 78, in _encode_key_value
return "%s%s" % (self._encode_string(key), self._encode_string(value))
File "/usr/local/lib/python3.7/site-packages/splunk_eventgen/lib/plugins/output/s2s.py", line 69, in _encode_string
"utf-8"
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 3: invalid continuation byte

To Reproduce
Steps to reproduce the behavior:
use outputmode=s2s

Expected behavior
no exception

Actual behavior
exception above

Do you run eventgen with SA-eventgen?
No

If you are using SA-Eventgen with Splunk (please complete the following information):
linux python 3.7
eventgen version git master

Activity

  1. ghost added
    bug
    on May 11, 2020
  2. ghost assigned on May 11, 2020
  3. ghost assigned on May 11, 2020
  4. ghost changed the title [-][BUG][/-] [+][BUG] Issue with S2S output mode and lines over 120 char[/+] on May 12, 2020
  5. aparajith21 commented on Nov 15, 2022

    @aparajith21

    Issue can be solved by replacing utf-8 with ISO-8859-1 or charmap, both of which have a 1 to 1 mapping between bytes and characters in /splunk_eventgen/lib/plugins/output/s2s.py. Can fix please assign

  6. removed their assignment
    on Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions