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

JSONResultsReader yields only the last message #499

Open
bendikro opened this issue Nov 22, 2022 · 1 comment
Open

JSONResultsReader yields only the last message #499

bendikro opened this issue Nov 22, 2022 · 1 comment

Comments

@bendikro
Copy link

bendikro commented Nov 22, 2022

This is more of a question than a bug report, as I don't know if it's actually a problem.

In JSONResultsReader, the code that handles messages looks like this:

if "messages" in parsed_line and parsed_line["messages"].__len__() > 0:
    for message in parsed_line["messages"]:
        msg_type = message.get("type", "Unknown Message Type")
        text = message.get("text")
    yield Message(msg_type, text)

Will there never be more than 1 message in messages? And if it is, it should probably be a comment to explain that. It's a bit weird to only return the last message without explaining why.

@ashah-splunk
Copy link
Contributor

Hi @bendikro Sorry for the delay in response.
Thanks for bringing this to our notice.
We are looking into this and will revert back with an update soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants