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

cisco_aironet: add ECS mapping for event.severity #11105

Merged

Conversation

zmoog
Copy link
Contributor

@zmoog zmoog commented Sep 11, 2024

Proposed commit message

Add ECS mapping for the event.severity field.

If a field has a string value, Elasticsearch maps it as a keyword. This happens even on stack versions 8.13+ because ecs@mappings does not perform type coercion.

According to the sample_event.json file, the event.severity field has a string value, so Elasticsearch maps it as a keyword instead of a long:

    "event": {
        "action": "ENTRY_DELETED",
        "agent_id_status": "verified",
        "dataset": "cisco_aironet.log",
        "ingested": "2023-09-25T17:34:47Z",
        "original": "<134>WLC001: *SISF BT Process: Aug 20 11:25:50.157: %SISF-6-ENTRY_DELETED: sisf_shim_utils.c:482 Entry deleted A=fe80::aee2:d3ff:feba:56a4 V=0 I=wired:1 P=0000 M=",
        "provider": "SISF",
        "severity": "6",
        "timezone": "+00:00"
    }

By adding the event.severity field to the file fields/ecs.yml we ensure it has the expected ECS mapping.

IMPORTANT: To fully resolve the issue, the input/integration owner should update it so that they can use the expected value to leverage ecs@mappings.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Related issues

@zmoog zmoog added Integration:cisco_aironet Cisco Aironet bugfix Pull request that fixes a bug issue labels Sep 11, 2024
@zmoog zmoog self-assigned this Sep 11, 2024
@zmoog zmoog marked this pull request as ready for review September 11, 2024 22:12
@zmoog zmoog requested a review from a team as a code owner September 11, 2024 22:12
@andrewkroh andrewkroh added the Team:Security-Deployment and Devices Deployment and Devices Security team [elastic/sec-deployment-and-devices] label Sep 11, 2024
@elasticmachine
Copy link

Pinging @elastic/sec-deployment-and-devices (Team:Security-Deployment and Devices)

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
Copy link
Contributor

@taylor-swanson taylor-swanson left a comment

Choose a reason for hiding this comment

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

The pipeline test is failing because it is expecting event.severity to be a long but is currently a string. We could either add a type annotation to the grok or add a convert processor. I don't have strong opinions either way.

  - grok:
      field: _temp_.full_message
      ignore_failure: true
      patterns:
        - "%{DATA:event.provider}-%{INT:event.severity:long}-%{DATA:event.action}: %{DATA}:%{INT} %{GREEDYDATA:message}"
        - "%{DATA:event.provider}-%{INT:event.severity:long}-%{DATA:event.action}: %{GREEDYDATA:message}"

Once that change is made, sample_event and readme also have to be regenerated.

@botelastic
Copy link

botelastic bot commented Oct 23, 2024

Hi! We just realized that we haven't looked into this PR in a while. We're sorry! We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1. Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Oct 23, 2024
[git-generate]
cd packages/cisco_aironet
elastic-package test pipeline -g && elastic-package test system -v -g && elastic-package build
@botelastic botelastic bot removed the Stalled label Nov 4, 2024
@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @zmoog

@andrewkroh
Copy link
Member

@taylor-swanson Can you please take another look. I addressed your comment in b0f92da.

@andrewkroh andrewkroh merged commit 165ca6f into elastic:main Dec 6, 2024
5 checks passed
@elastic-vault-github-plugin-prod

Package cisco_aironet - 1.14.2 containing this change is available at https://epr.elastic.co/package/cisco_aironet/1.14.2/

harnish-elastic pushed a commit to harnish-elastic/integrations that referenced this pull request Feb 4, 2025
The problem is that the `ecs@mappings` component template (introduced in >=8.13.0) 
does not perform type coercion to long when the value was a string. In this 
specific integration scenario, the `event.severity` value was provided as a 
string. So the dynamic mapping never matched, which left `event.severity` with 
the default 'keyword' mapping type, which does not comply with ECS.

This change adds back the static mapping for `event.severity` and modifies the 
grok pattern to perform conversion to long.

Relates: elastic#10848

---------

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
qcorporation pushed a commit that referenced this pull request Feb 4, 2025
The problem is that the `ecs@mappings` component template (introduced in >=8.13.0) 
does not perform type coercion to long when the value was a string. In this 
specific integration scenario, the `event.severity` value was provided as a 
string. So the dynamic mapping never matched, which left `event.severity` with 
the default 'keyword' mapping type, which does not comply with ECS.

This change adds back the static mapping for `event.severity` and modifies the 
grok pattern to perform conversion to long.

Relates: #10848

---------

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
harnish-elastic pushed a commit to harnish-elastic/integrations that referenced this pull request Feb 5, 2025
The problem is that the `ecs@mappings` component template (introduced in >=8.13.0) 
does not perform type coercion to long when the value was a string. In this 
specific integration scenario, the `event.severity` value was provided as a 
string. So the dynamic mapping never matched, which left `event.severity` with 
the default 'keyword' mapping type, which does not comply with ECS.

This change adds back the static mapping for `event.severity` and modifies the 
grok pattern to perform conversion to long.

Relates: elastic#10848

---------

Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull request that fixes a bug issue Integration:cisco_aironet Cisco Aironet Team:Security-Deployment and Devices Deployment and Devices Security team [elastic/sec-deployment-and-devices]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants