Skip to content

sophos: fix log config indentation - #6773

Merged
efd6 merged 1 commit into
elastic:mainfrom
efd6:6690-sophos
Jul 3, 2023
Merged

sophos: fix log config indentation#6773
efd6 merged 1 commit into
elastic:mainfrom
efd6:6690-sophos

Conversation

@efd6

@efd6 efd6 commented Jul 3, 2023

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes indentation in the log config yml/hbs.

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

@efd6 efd6 added bug Something isn't working, use only for issues Integration:sophos Sophos labels Jul 3, 2023
@efd6 efd6 self-assigned this Jul 3, 2023
@elasticmachine

elasticmachine commented Jul 3, 2023

Copy link
Copy Markdown

💚 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-07-03T04:35:35.908+0000

  • Duration: 19 min 34 sec

Test stats 🧪

Test Results
Failed 0
Passed 31
Skipped 0
Total 31

🤖 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
Copy Markdown

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (2/2) 💚
Files 100.0% (13/13) 💚 2.865
Classes 100.0% (13/13) 💚 2.865
Methods 98.901% (90/91) 👍 6.707
Lines 93.776% (1808/1928) 👍 1.947
Conditionals 100.0% (0/0) 💚
@efd6
efd6 marked this pull request as ready for review July 3, 2023 06:03
@efd6
efd6 requested a review from a team as a code owner July 3, 2023 06:03
@elasticmachine

Copy link
Copy Markdown

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

@bhapas bhapas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

Just thinking if we can catch these kind of errors at build / check process? Can package-spec catch these errors

cc: @andrewkroh

@andrewkroh andrewkroh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How can we improve here? Why didn't this get caught by a test case? Is this missing a system test for the log input? Is there any validation we can propose in package-spec to catch this? 🤔

@andrewkroh

Copy link
Copy Markdown
Contributor

Just thinking if we can catch these kind of errors at build / check process? Can package-spec catch these errors

@bhapas It seems we are thinking the same way.

@efd6

efd6 commented Jul 3, 2023

Copy link
Copy Markdown
Contributor Author

How can we improve here? Why didn't this get caught by a test case? Is this missing a system test for the log input? Is there any validation we can propose in package-spec to catch this? 🤔

This did not get caught because the document is not a yaml document until it has been template-expanded.

I was thinking about how to catch this in testing and the only thing I could come up with given the constraint of having a document that is essentially free-form — mod the handlebars syntax requirements — would be to have EP expand the template with valid-for-type values and confirm that the yaml is valid.

@efd6
efd6 merged commit 8e081f6 into elastic:main Jul 3, 2023
@efd6

efd6 commented Jul 3, 2023

Copy link
Copy Markdown
Contributor Author

An approach could be to check whether there is any /^\t/ in the hbs files. This would under-report. A more brutal approach would be to check whether there are any /^\s*\t+\s*/; this would over-report since it is valid to have tabs in text.

@elasticmachine

Copy link
Copy Markdown

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

@andrewkroh

Copy link
Copy Markdown
Contributor

would be to have EP expand the template with valid-for-type values and confirm that the yaml is valid.

That's similar to what I was thinking in the general case to validate handlebars and the yaml.

But I think in this particular case of sophos the integration is missing a system test for log. It has one for the other input types, but not log.

@efd6
efd6 deleted the 6690-sophos branch February 5, 2025 22:08
orestisfl pushed a commit to orestisfl/integrations that referenced this pull request May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working, use only for issues Integration:sophos Sophos

4 participants