Skip to content

Conversation

@ShourieG
Copy link
Contributor

@ShourieG ShourieG commented Aug 31, 2023

Type of change

  • Bug

What does this PR do?

It was noted by many users that often falcon data-stream logs get dropped due to a tag parsing issue. The field in question here is the crowdstrike.event.Tags. It was observed from client feedback from SDHs and also personal testing that the value of this field can sometimes be an array of objects, a comma separated string or a normal string.

What existed in the pipeline:
The pipeline defined the field Tags as of type nested. This obviously caused issues when the value would be a string or a comma separated string as they would result in mapping errors when pushed to elasticsearch.

What was the solution:

  1. We decided to consolidate all the Tags under ctx.tags which resides at the document root. This would avoid
    having different tag fields for different type of Tags.
  2. If crowdstrike.event.Tags is an array of objects we concatenate the "Key" and "ValueString" which are the only two
    attributes per object into a string format "Key:ValueString" and append it to ctx.tags.
  3. If crowdstrike.event.Tags is a comma separated string, we split it and transform it into a List and append each
    element of the list to ctx.tags
  4. If crowdstrike.event.Tags is a standard string, we simply append it to ctx.tags.
  5. Finally we remove the field crowdstrike.event.Tags

This ensures consistent tag handling across the data-stream for all type of logs.

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.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@ShourieG ShourieG requested a review from a team as a code owner August 31, 2023 12:45
@ShourieG ShourieG self-assigned this Aug 31, 2023
@elasticmachine
Copy link

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

@ShourieG ShourieG added bugfix Pull request that fixes a bug issue 8.10 candidate labels Aug 31, 2023
@elasticmachine
Copy link

elasticmachine commented Aug 31, 2023

💚 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-09-01T08:12:10.786+0000

  • Duration: 15 min 10 sec

Test stats 🧪

Test Results
Failed 0
Passed 30
Skipped 0
Total 30

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Aug 31, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (2/2) 💚
Files 100.0% (15/15) 💚 3.32
Classes 100.0% (15/15) 💚 3.32
Methods 95.876% (93/97) 👍 3.54
Lines 88.201% (3588/4068) 👍 0.137
Conditionals 100.0% (0/0) 💚
@ShourieG ShourieG requested review from P1llus and kcreddy August 31, 2023 13:59
Copy link
Contributor

@kcreddy kcreddy left a comment

Choose a reason for hiding this comment

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

Minor suggestions. Rest LGTM 👍🏼

Copy link
Contributor

@bhapas bhapas left a comment

Choose a reason for hiding this comment

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

Minor comment. LGTM otherwise

@ShourieG ShourieG merged commit e690b60 into elastic:main Sep 1, 2023
@ShourieG ShourieG deleted the bugfix/crowdstrike_flacon_tags branch September 1, 2023 08:30
@elasticmachine
Copy link

Package crowdstrike - 1.18.2 containing this change is available at https://epr.elastic.co/search?package=crowdstrike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.10 candidate bugfix Pull request that fixes a bug issue Integration:crowdstrike CrowdStrike

5 participants