Skip to content

Conversation

@chrisberkhout
Copy link
Contributor

@chrisberkhout chrisberkhout commented Jan 13, 2025

Proposed commit message

[jamf_pro] Inventory date formatting for filter

Ensure that `reportDate` values with less than 3 digits of a fractional
second will be padded with zeros to 3 digits before they are used in
the `filter` parameter.

Avoids HTTP 400 responses saying:

> Date [2025-01-08T10:50:26.6Z] does not match any of supported formats:
> yyyy-MM-ddTHH:mm:ss.SSSZ, yyyy-MM-ddTHH:mm:ss.SSZ,
> yyyy-MM-ddTHH:mm:ssZ, yyyy-MM-dd*, yyyy-MM-dd, yyyy-MM*, yyyy*

Also improves the CEL error handling by returning a single event
outside of an array (which will be logged).

This has been manually tested against the live API.

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.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

How to test this PR locally

The system test has been updated to demonstrate the new functionality.

Related issues

@chrisberkhout chrisberkhout requested a review from a team as a code owner January 13, 2025 10:41
@chrisberkhout chrisberkhout changed the title Pad dates. [jamf_pro] Inventory date formatting for filter Jan 13, 2025
@chrisberkhout chrisberkhout self-assigned this Jan 13, 2025
@chrisberkhout chrisberkhout added bugfix Pull request that fixes a bug issue Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Integration:jamf_pro Jamf Pro labels Jan 13, 2025
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@kcreddy
Copy link
Contributor

kcreddy commented Jan 15, 2025

/test

@elasticmachine
Copy link

💚 Build Succeeded

History

  • 💚 Build #20349 succeeded 5fe42ce3a1422b3adf1ed65c0951239f640cc5c3

cc @chrisberkhout

@elastic-sonarqube
Copy link

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.

LGTM

@chrisberkhout chrisberkhout merged commit 6db5d14 into elastic:main Jan 15, 2025
5 checks passed
@elastic-vault-github-plugin-prod

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

harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 4, 2025
Ensure that `reportDate` values with less than 3 digits of a fractional
second will be padded with zeros to 3 digits before they are used in
the `filter` parameter.

Avoids HTTP 400 responses saying:

> Date [2025-01-08T10:50:26.6Z] does not match any of supported formats:
> yyyy-MM-ddTHH:mm:ss.SSSZ, yyyy-MM-ddTHH:mm:ss.SSZ,
> yyyy-MM-ddTHH:mm:ssZ, yyyy-MM-dd*, yyyy-MM-dd, yyyy-MM*, yyyy*

Also improves the CEL error handling by returning a single event
outside of an array (which will be logged).

This has been manually tested against the live API.
harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 5, 2025
Ensure that `reportDate` values with less than 3 digits of a fractional
second will be padded with zeros to 3 digits before they are used in
the `filter` parameter.

Avoids HTTP 400 responses saying:

> Date [2025-01-08T10:50:26.6Z] does not match any of supported formats:
> yyyy-MM-ddTHH:mm:ss.SSSZ, yyyy-MM-ddTHH:mm:ss.SSZ,
> yyyy-MM-ddTHH:mm:ssZ, yyyy-MM-dd*, yyyy-MM-dd, yyyy-MM*, yyyy*

Also improves the CEL error handling by returning a single event
outside of an array (which will be logged).

This has been manually tested against the live API.
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:jamf_pro Jamf Pro Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants