Skip to content

Conversation

@vishaangelova
Copy link
Contributor

@vishaangelova vishaangelova commented Nov 18, 2025

This PR fixes errors in code blocks in the Fleet docs using an AI assistant (Cursor) and semantic code search in Elastic repos for identifying and confirming the errors.

It also fixes a couple of smaller issues:

  • removes empty columns
  • removes a reference to the apm-data plugin (unrelated to the specific doc’s other content)
  • makes some descriptions (in tables) a bit more accurate.

——

AI-assisted by Cursor using the claude-4.5-sonnet (thinking) model; necessary changes were identified in multiple iterations.

@vishaangelova vishaangelova requested a review from a team as a code owner November 18, 2025 17:52
# If kube_config is not set, KUBECONFIG environment variable will be checked
# and if not present it will fall back to InCluster
kube_config: ${fleet} and {agent} Guide/.kube/config
kube_config: ~/.kube/config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wowzer. This must've been a bad regex match? Good find.

Comment on lines +152 to +155
| `event.provider` | `winlog.provider_name` | `Name` attribute |
| `event.action` | `winlog.task` | |
| `event.outcome` | `winlog.outcome` | |
| `host.name` | `winlog.computer_name` | |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to validate these changes

Copy link
Contributor Author

@vishaangelova vishaangelova Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bmorelli25, yeah, I should have added a note about this change as it’s not obvious.. Originally, Cursor only highlighted that event.host.name should be changed to host.name. Here’s what it said:

  1. decode_xml_wineventlog-processor.md - Inconsistent Field Mapping Documentation
    File: decode_xml_wineventlog-processor.md (Lines 148-158)
    Issue: The ECS field mapping table shows event.host.name but this is not a standard ECS field. The correct field is host.name.
    Current Documentation:
    | event.host.name | <Event><System><Computer> |
    Recommendation:
    | host.name | <Event><System><Computer> |
    Based on the source code and the actual output example in the same file (lines 49-51), the correct ECS field is host.name, not event.host.name.

So I went ahead and checked the example it refers to on line 39-87 (this is a link to the original doc before the current change).

Because the original table for mapping the ECS fields, where the AI found the error, was inconsistent in how it referred to the winlog fields, I checked the example and figured out I could replace <Event><System><Provider> with the respective winlog field name that matched based on the example - see lines 47 and 61.

I applied the same logic for the other changes in the Field column - checking against the winlog fields that are in the example. Does that make sense?

It made sense to me, but I’m not an expert, so if you think it would be safer to stick with the original values, I can revert these changes and we could only keep event.host.name -> host.name. Or revert that as well?

Copy link
Contributor Author

@vishaangelova vishaangelova Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just another thought:

So the doc includes two tables at the end:

Because the second column says "Source XML or other field”, I suppose it’s not incorrect to have mixed values in this column, including both winlog fields and the original event information, so my change may be unnecessary. But they’re essentially the same thing as far as I understand (because of the mapping: original event info -> winglog fields -> ECS fields).

Hmm 🤔 If we go with the winlog fields as the values in the "Source XML or other field” column, then maybe the third column “Notes” and the information about the Name attribute should also be deleted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation.

So I agree that event.host.namehost.name is definitely correct as ECS doesn’t have event.host.name.

And I now understand what the other changes are. I guess whether the “Source XML or other field” column says winlog.provider_name or <Event><System><Provider> is just a question of which stage in the pipeline we choose to show. The value itself is the same.

Also the column is literally titled “Source XML or other field”, so having a mix of raw XML and winlog.* is not incorrect. Standardizing on winlog where we already have a clear winlog mapping arguably makes the ECS table easier to read.

Also also, if the source column says winlog.provider_name, I still think it’s still helpful to say that it comes from the provider Name attribute” in the notes (as the Guid attribute matches the same pattern). So I don't think I'd get rid of that.

You could have an extra column and call out XML in one column and field in the other. But idk if that's needed.

tl;dr I think this is an okay change as the information is correct and the table is now easier to read.

Copy link
Member

@bmorelli25 bmorelli25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are some really great finds! One question above.

@vishaangelova vishaangelova self-assigned this Nov 19, 2025
@vishaangelova vishaangelova enabled auto-merge (squash) November 20, 2025 07:20
@vishaangelova vishaangelova merged commit 3a2c055 into main Nov 20, 2025
7 checks passed
@vishaangelova vishaangelova deleted the on-week-improve-code-block-examples branch November 20, 2025 07:23
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

Successfully merging this pull request may close these issues.

3 participants