-
Notifications
You must be signed in to change notification settings - Fork 102
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] Problem with getting ctx.results #479
Comments
@zil1 could you add what the query and output looks like? |
Slack destination:
Message in Slack:
|
@zil1 I see that you have raised a concern for "Per document monitor" in specific. For per doc monitors, have you checked out Document Findings? In Here is the sample context body from a dummy alert I created in a Per document monitor for reference:
A monitor can run multiple queries in execution but ctx.alerts would contain all the information relevant to that particular document and alert. Do you have any use case requiring you to consume results of all the queries run by the monitor in that execution? |
@eirsep, for example, I want to get the "message" field in a document
|
@zil1 Just to confirm on the ask here, are you suggesting that in addition to the document findings which are part of the alerts today (which contains the specific document id which caused the alerts), you also would want to have the same set of document ids part of the results field as well? |
@getsaurabh02 yes, if possible |
/cc: @brijos to provide some context on the behavior. |
Not sure if its the same use-case; but I personally would like to send document context (actual fields of a document) in a per-document monitor. For example, you have syslog -> logstash -> opensearch and you want to monitor logs from different hosts that have a certain severity/message ie. severity:crit and message:"something superbad" ideally the actions should be able to notify the channel with the context "hostX just logged a crit alert - something superbad". Apologies if this is documented somewhere, I really have been unable to find the best way of achieving this. |
I'd like to second this request. It allows the creation of much more useful alert messages, which contain key information for troubleshooting without first looking up. For me, the document includes a correlation_id, which would be incredibly useful to show directly in the alert manage. As its a per document monitor, it would be very useful to access the document that triggers the alert. |
I'll give another up-vote on this. Having a per-document alert that includes the content of the document in the alert is the one thing I haven't been able to find a way to do. I found this discussion after my trials and it seems I'm not the first person with this request. It looks like the change was done, but not merged because there wasn't an easy way to test? Has there been any more movement on that front, or has this request fallen off the priority list? |
I also need this. |
Facing similar issue and seems like this feature is much needed. Accessing the document fields directly using |
Sample document support was added in #1450. Can you check if that solves the issues you are facing? |
When sending an alert, ctx.result is returned {}, while ctx.error does not return anything.
When trying to send ctx.result.0 , the message is not sent, and an error appears in the logs:
How can one reproduce the bug?
Steps to reproduce the behavior:
What is your host/environment?
The text was updated successfully, but these errors were encountered: