Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ghost opened this issue May 11, 2020 · 1 comment
Open

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

ghost opened this issue May 11, 2020 · 1 comment
Assignees
Labels
bug Malfunctioning Eventgen due to potential bug

Comments

@ghost
Copy link

ghost commented May 11, 2020

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

@ghost ghost added the bug Malfunctioning Eventgen due to potential bug label May 11, 2020
@ghost ghost changed the title [BUG] [BUG] Issue with S2S output mode and lines over 120 char May 12, 2020
@aparajith21
Copy link

aparajith21 commented Nov 15, 2022

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

@li-wu li-wu removed their assignment Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Malfunctioning Eventgen due to potential bug
Projects
None yet
Development

No branches or pull requests

6 participants