-
Notifications
You must be signed in to change notification settings - Fork 318
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
Fix a critical bug of Splunk results reader, lack of pagination #657
Fix a critical bug of Splunk results reader, lack of pagination #657
Conversation
@microsoft-github-policy-service agree |
I prepared my PoC notebook file and my test Splunk csv data for this bug debugging. https://github.com/Tatsuya-hasegawa/MSTICPy_utils/blob/main/qp_splunk_poc_bugfix/msticpy_qp_splunk.ipynb Thank you. |
On the other hands, add_query_items='', count=0 options in normal search mode worked fine in the past official notebook I'm thinking the diff was caused by Splunk python SDK updates. FYI: My Splunk Versions is Splunk Enterprise 8.2.3. |
Hey thanks @Tatsuya-hasegawa - Assuming the tests complete OK, I will complete this. |
Thank you for the reply, @ianhelle This CI test looks throwing this error, however is_ready() function certainly exists on splunk client and also work fine on my test splunk instance.
I feel the Mock response may not be enough comparing to the real splunk client's function. Please feel free to teach me if there is an additional anything I had better improve in order for this PR to be merged. Sincerely, |
Updated failing tests for new code.
Yeah, the tests are mocked because we can't run against a live splunk instance. |
/azpipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't really need changes - if you could check that my code changes look OK and test them in your environment it would be super helpful.
Hello, I will check your changed code right now, however I am in a location without my dev PC now, so I will spend some time more than usual. |
No hurry at all - I will on vacation for the next 2 weeks, so whenever you get a chance. |
Thanks ! |
I have tested your committed code in my test Splunk. I'm looking forward to seeing this fix on version 2.5,0. Thank you very much for this handling ! |
/azpipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
Thank you for merging. |
Hello msticpy team,
I found a critical bug which cannot retrieve only first 100 records from Splunk with SplunkGeneral.get_events_parameterized function in spite of
add_query_items='', count=0.
msticpy version = 2.4.0 (latest)
Evidence file
It happens when oneshot=False and I found that the pagination was not implemented in normal search (i.e.
kwargs_normalsearch = {"exec_mode": "normal"}
).That is why Splunk SDK's resultReader never fetch except first 100 records.
This PR is to implement the pagination and add paginate_width implicit option to the function.
In addition, I suggest the replacement from ResultReader to JSONResultReader to avoiding the deprecation warning.
The warning was below on the previous code.
I replaced as following.
Thank you.
I'm happy this will be merged.
Best regards,