-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Unable to filter more than 22 eventIDs #1491
Comments
When I implemented the first round of "filtering" I was thinking in the future Winlogbeat could support more advanced queries like shown below. This would be a work around if it existed.
We don't have plans to add this in the immediate future (5.0 or 5.1) because we're working on other Beat features. But if anyone is interested in contributing, this would be a cool feature. Probably the raw XML query is the easiest to implement. |
@andrewkroh given this restriction, should we add a mention in the documentation? We could add a disclaimer at https://www.elastic.co/guide/en/beats/winlogbeat/current/configuration-winlogbeat-options.html#_event_logs_event_id . What do you think? Looks like an API issue, so nothing that can be actually fixed in Winlogbeat. Other than splitting the event_ids if the list is larger than 22 items into 2, without letting the user know that this internally happen. |
Add a note and workaround to the Winlogbeat docs about the limit of 22 event IDs in a query. And provide a workaround for #1491 using filters.
Add a note and workaround to the Winlogbeat docs about the limit of 22 event IDs in a query. And provide a workaround for elastic#1491 using filters.
Add a note and workaround to the Winlogbeat docs about the limit of 22 event IDs in a query. And provide a workaround for elastic#1491 using filters.
@andrewkroh I see we updated the docs related to this. Is this still a limitation? If yes, should we change this from |
This can be closed. We have a workaround documented. And a separate enhancement request for advancing the query syntax in #1054. |
Hi, even if this is closed because there's a proposed enhancement for direct XML query syntax, I'm noticed that the limitation of 22 logical boolean operands (I only confirmed with 'or') is a "top level" limit, but grouping operands can work around the limit. E.g. I confirmed this in powershell: (10, 22, 23, 30) | %{
$lower=1000
$upper=1000 + $_
$XPathString = '*[System[EventID=' + ($lower..$upper -join ' or EventID=') + ']]'
Write-Information "`nEvent IDs in query: $_"
Write-Information "XPathStringLength: $($XPathString.Length)"
Get-WinEvent -FilterXml "<QueryList><Query Id=`"0`"><Select Path=`"System`">$XPathString</Select></Query></QueryList>" -MaxEvents 1
}
# Grouped?
$XPathString = '*[System[(EventID=' + (1000..1020 -join ' or EventID=') + ') or (EventID=' + (2000..2020 -join ' or EventID=') + ')]]'
Write-Information "`nEvent IDs in query: 20 in each of 2 groups = 40"
Write-Information "XPathStringLength: $($XPathString.Length)"
Get-WinEvent -FilterXml "<QueryList><Query Id=`"0`"><Select Path=`"System`">$XPathString</Select></Query></QueryList>" -MaxEvents 1 |
Add a note and workaround to the Winlogbeat docs about the limit of 22 event IDs in a query. And provide a workaround for elastic#1491 using filters.
Add a note and workaround to the Winlogbeat docs about the limit of 22 event IDs in a query. And provide a workaround for elastic#1491 using filters.
event_id: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
The relevant output from -e -d "*"
According to KB9704531 , more than 22 event sources need to be split into seperate queries.
I have successfully tested the following query in event viewer where the above query fails
The text was updated successfully, but these errors were encountered: