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

winlogbeat/docs: adjust XPath query term limit warning #34715

Merged
merged 1 commit into from Mar 6, 2023

Conversation

efd6
Copy link
Contributor

@efd6 efd6 commented Mar 2, 2023

What does this PR do?

Adjusts unclear documentation and removes a link to a now-404ing page.

The page linked to in the docs is now a 404 suggeesting that the issue has been fixed. The only currently noted limitations on XPath are described at https://learn.microsoft.com/en-us/windows/win32/wes/consuming-events#xpath-10-limitations

Why is it important?

The existing documentation is confusing.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@efd6 efd6 self-assigned this Mar 2, 2023
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Mar 2, 2023
The page linked to in the docs is now a 404 suggeesting that the issue
has been fixed. The only currently noted limitations on XPath are
described at https://learn.microsoft.com/en-us/windows/win32/wes/consuming-events#xpath-10-limitations

This page is captured by the wayback machine.

Windows Event Log supports a subset of XPath 1.0. The primary restriction is
that only XML elements that represent events can be selected by an event
selector. An XPath query that does not select an event is not valid. All
valid selector paths start with * or "Event". All location paths operate on
the event nodes and are composed of a series of steps. Each step is a
structure of three parts: the axis, node test, and predicate. For more
information about these parts and about XPath 1.0, see XML Path Language
(XPath). Windows Event Log places the following restrictions on the
expression:

* Axis: Only the Child (default) and Attribute (and its shorthand "@") axis
  are supported.
* Node Tests: Only node names and NCName tests are supported. The "*"
  character, which selects any character, is supported.
* Predicates: Any valid XPath expression is acceptable if the location paths
  conform to the following restrictions:
    * Standard operators OR, AND, =, !=, <=, <, >=, >, and parentheses are
      supported.
    * Generating a string value for a node name is not supported.
    * Evaluation in reverse order is not supported.
    * Node sets are not supported.
    * Namespace scoping is not supported.
    * Namespace, processing, and comment nodes are not supported.
    * Context size is not supported.
    * Variable bindings are not supported.
    * The position function, and its shorthand array reference, is supported
      (on leaf nodes only).
    * The Band function is supported. The function performs a bitwise AND for
      two integer number arguments. If the result of the bitwise AND is
      nonzero, the function evaluates to true; otherwise, the function
      evaluates to false.
    * The timediff function is supported. The function computes the difference
      between the second argument and the first argument. One of the
      arguments must be a literal number. The arguments must use FILETIME
      representation. The result is the number of milliseconds between the
      two times. The result is positive if the second argument represents a
      later time; otherwise, it is negative. When the second argument is not
      provided, the current system time is used.
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-03-02T00:37:09.062+0000

  • Duration: 8 min 56 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@efd6 efd6 marked this pull request as ready for review March 2, 2023 00:49
@efd6 efd6 requested a review from a team as a code owner March 2, 2023 00:49
@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@efd6
Copy link
Contributor Author

efd6 commented Mar 2, 2023

@elasticmachine run elasticsearch-ci/docs

@efd6 efd6 merged commit 5047714 into elastic:main Mar 6, 2023
8 checks passed
mergify bot pushed a commit that referenced this pull request Mar 6, 2023
The page linked to in the docs is now a 404 suggesting that the issue
has been fixed. The only currently noted limitations on XPath are
described at https://learn.microsoft.com/en-us/windows/win32/wes/consuming-events#xpath-10-limitations

This page is captured by the wayback machine.

Windows Event Log supports a subset of XPath 1.0. The primary restriction is
that only XML elements that represent events can be selected by an event
selector. An XPath query that does not select an event is not valid. All
valid selector paths start with * or "Event". All location paths operate on
the event nodes and are composed of a series of steps. Each step is a
structure of three parts: the axis, node test, and predicate. For more
information about these parts and about XPath 1.0, see XML Path Language
(XPath). Windows Event Log places the following restrictions on the
expression:

* Axis: Only the Child (default) and Attribute (and its shorthand "@") axis
  are supported.
* Node Tests: Only node names and NCName tests are supported. The "*"
  character, which selects any character, is supported.
* Predicates: Any valid XPath expression is acceptable if the location paths
  conform to the following restrictions:
    * Standard operators OR, AND, =, !=, <=, <, >=, >, and parentheses are
      supported.
    * Generating a string value for a node name is not supported.
    * Evaluation in reverse order is not supported.
    * Node sets are not supported.
    * Namespace scoping is not supported.
    * Namespace, processing, and comment nodes are not supported.
    * Context size is not supported.
    * Variable bindings are not supported.
    * The position function, and its shorthand array reference, is supported
      (on leaf nodes only).
    * The Band function is supported. The function performs a bitwise AND for
      two integer number arguments. If the result of the bitwise AND is
      nonzero, the function evaluates to true; otherwise, the function
      evaluates to false.
    * The timediff function is supported. The function computes the difference
      between the second argument and the first argument. One of the
      arguments must be a literal number. The arguments must use FILETIME
      representation. The result is the number of milliseconds between the
      two times. The result is positive if the second argument represents a
      later time; otherwise, it is negative. When the second argument is not
      provided, the current system time is used.

(cherry picked from commit 5047714)
mergify bot pushed a commit that referenced this pull request Mar 6, 2023
The page linked to in the docs is now a 404 suggesting that the issue
has been fixed. The only currently noted limitations on XPath are
described at https://learn.microsoft.com/en-us/windows/win32/wes/consuming-events#xpath-10-limitations

This page is captured by the wayback machine.

Windows Event Log supports a subset of XPath 1.0. The primary restriction is
that only XML elements that represent events can be selected by an event
selector. An XPath query that does not select an event is not valid. All
valid selector paths start with * or "Event". All location paths operate on
the event nodes and are composed of a series of steps. Each step is a
structure of three parts: the axis, node test, and predicate. For more
information about these parts and about XPath 1.0, see XML Path Language
(XPath). Windows Event Log places the following restrictions on the
expression:

* Axis: Only the Child (default) and Attribute (and its shorthand "@") axis
  are supported.
* Node Tests: Only node names and NCName tests are supported. The "*"
  character, which selects any character, is supported.
* Predicates: Any valid XPath expression is acceptable if the location paths
  conform to the following restrictions:
    * Standard operators OR, AND, =, !=, <=, <, >=, >, and parentheses are
      supported.
    * Generating a string value for a node name is not supported.
    * Evaluation in reverse order is not supported.
    * Node sets are not supported.
    * Namespace scoping is not supported.
    * Namespace, processing, and comment nodes are not supported.
    * Context size is not supported.
    * Variable bindings are not supported.
    * The position function, and its shorthand array reference, is supported
      (on leaf nodes only).
    * The Band function is supported. The function performs a bitwise AND for
      two integer number arguments. If the result of the bitwise AND is
      nonzero, the function evaluates to true; otherwise, the function
      evaluates to false.
    * The timediff function is supported. The function computes the difference
      between the second argument and the first argument. One of the
      arguments must be a literal number. The arguments must use FILETIME
      representation. The result is the number of milliseconds between the
      two times. The result is positive if the second argument represents a
      later time; otherwise, it is negative. When the second argument is not
      provided, the current system time is used.

(cherry picked from commit 5047714)
efd6 added a commit that referenced this pull request Mar 6, 2023
The page linked to in the docs is now a 404 suggesting that the issue
has been fixed. The only currently noted limitations on XPath are
described at https://learn.microsoft.com/en-us/windows/win32/wes/consuming-events#xpath-10-limitations

This page is captured by the wayback machine.

Windows Event Log supports a subset of XPath 1.0. The primary restriction is
that only XML elements that represent events can be selected by an event
selector. An XPath query that does not select an event is not valid. All
valid selector paths start with * or "Event". All location paths operate on
the event nodes and are composed of a series of steps. Each step is a
structure of three parts: the axis, node test, and predicate. For more
information about these parts and about XPath 1.0, see XML Path Language
(XPath). Windows Event Log places the following restrictions on the
expression:

* Axis: Only the Child (default) and Attribute (and its shorthand "@") axis
  are supported.
* Node Tests: Only node names and NCName tests are supported. The "*"
  character, which selects any character, is supported.
* Predicates: Any valid XPath expression is acceptable if the location paths
  conform to the following restrictions:
    * Standard operators OR, AND, =, !=, <=, <, >=, >, and parentheses are
      supported.
    * Generating a string value for a node name is not supported.
    * Evaluation in reverse order is not supported.
    * Node sets are not supported.
    * Namespace scoping is not supported.
    * Namespace, processing, and comment nodes are not supported.
    * Context size is not supported.
    * Variable bindings are not supported.
    * The position function, and its shorthand array reference, is supported
      (on leaf nodes only).
    * The Band function is supported. The function performs a bitwise AND for
      two integer number arguments. If the result of the bitwise AND is
      nonzero, the function evaluates to true; otherwise, the function
      evaluates to false.
    * The timediff function is supported. The function computes the difference
      between the second argument and the first argument. One of the
      arguments must be a literal number. The arguments must use FILETIME
      representation. The result is the number of milliseconds between the
      two times. The result is positive if the second argument represents a
      later time; otherwise, it is negative. When the second argument is not
      provided, the current system time is used.

(cherry picked from commit 5047714)

Co-authored-by: Dan Kortschak <90160302+efd6@users.noreply.github.com>
efd6 added a commit that referenced this pull request Mar 6, 2023
The page linked to in the docs is now a 404 suggesting that the issue
has been fixed. The only currently noted limitations on XPath are
described at https://learn.microsoft.com/en-us/windows/win32/wes/consuming-events#xpath-10-limitations

This page is captured by the wayback machine.

Windows Event Log supports a subset of XPath 1.0. The primary restriction is
that only XML elements that represent events can be selected by an event
selector. An XPath query that does not select an event is not valid. All
valid selector paths start with * or "Event". All location paths operate on
the event nodes and are composed of a series of steps. Each step is a
structure of three parts: the axis, node test, and predicate. For more
information about these parts and about XPath 1.0, see XML Path Language
(XPath). Windows Event Log places the following restrictions on the
expression:

* Axis: Only the Child (default) and Attribute (and its shorthand "@") axis
  are supported.
* Node Tests: Only node names and NCName tests are supported. The "*"
  character, which selects any character, is supported.
* Predicates: Any valid XPath expression is acceptable if the location paths
  conform to the following restrictions:
    * Standard operators OR, AND, =, !=, <=, <, >=, >, and parentheses are
      supported.
    * Generating a string value for a node name is not supported.
    * Evaluation in reverse order is not supported.
    * Node sets are not supported.
    * Namespace scoping is not supported.
    * Namespace, processing, and comment nodes are not supported.
    * Context size is not supported.
    * Variable bindings are not supported.
    * The position function, and its shorthand array reference, is supported
      (on leaf nodes only).
    * The Band function is supported. The function performs a bitwise AND for
      two integer number arguments. If the result of the bitwise AND is
      nonzero, the function evaluates to true; otherwise, the function
      evaluates to false.
    * The timediff function is supported. The function computes the difference
      between the second argument and the first argument. One of the
      arguments must be a literal number. The arguments must use FILETIME
      representation. The result is the number of milliseconds between the
      two times. The result is positive if the second argument represents a
      later time; otherwise, it is negative. When the second argument is not
      provided, the current system time is used.

(cherry picked from commit 5047714)

Co-authored-by: Dan Kortschak <90160302+efd6@users.noreply.github.com>
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
The page linked to in the docs is now a 404 suggesting that the issue
has been fixed. The only currently noted limitations on XPath are
described at https://learn.microsoft.com/en-us/windows/win32/wes/consuming-events#xpath-10-limitations

This page is captured by the wayback machine.

Windows Event Log supports a subset of XPath 1.0. The primary restriction is
that only XML elements that represent events can be selected by an event
selector. An XPath query that does not select an event is not valid. All
valid selector paths start with * or "Event". All location paths operate on
the event nodes and are composed of a series of steps. Each step is a
structure of three parts: the axis, node test, and predicate. For more
information about these parts and about XPath 1.0, see XML Path Language
(XPath). Windows Event Log places the following restrictions on the
expression:

* Axis: Only the Child (default) and Attribute (and its shorthand "@") axis
  are supported.
* Node Tests: Only node names and NCName tests are supported. The "*"
  character, which selects any character, is supported.
* Predicates: Any valid XPath expression is acceptable if the location paths
  conform to the following restrictions:
    * Standard operators OR, AND, =, !=, <=, <, >=, >, and parentheses are
      supported.
    * Generating a string value for a node name is not supported.
    * Evaluation in reverse order is not supported.
    * Node sets are not supported.
    * Namespace scoping is not supported.
    * Namespace, processing, and comment nodes are not supported.
    * Context size is not supported.
    * Variable bindings are not supported.
    * The position function, and its shorthand array reference, is supported
      (on leaf nodes only).
    * The Band function is supported. The function performs a bitwise AND for
      two integer number arguments. If the result of the bitwise AND is
      nonzero, the function evaluates to true; otherwise, the function
      evaluates to false.
    * The timediff function is supported. The function computes the difference
      between the second argument and the first argument. One of the
      arguments must be a literal number. The arguments must use FILETIME
      representation. The result is the number of milliseconds between the
      two times. The result is positive if the second argument represents a
      later time; otherwise, it is negative. When the second argument is not
      provided, the current system time is used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.8-candidate backport-v7.17.0 Automated backport with mergify backport-v8.7.0 Automated backport with mergify bug docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants