Skip to content

[zscaler_zpa] Cleanup empty field from json to avoid errors #14493

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SimonKoetting
Copy link
Contributor

@SimonKoetting SimonKoetting commented Jul 10, 2025

Zscaler uses a template language to send logs. As a result, it's possible for a
field in the JSON we receive to exist but have an empty string as its value.

For date processors in the pipeline, this issue has already been addressed
using conditions like
ctx.json?.LogTimestamp != null && ctx.json.LogTimestamp != ''.

However, we encountered a problem with a user where a non-date field failed
to convert to an IP address due to the error message:
'' is not an IP string literal.

To prevent this from happening with any field, I propose adding a cleanup step
at the beginning of the pipeline in this PR. This would handle all empty fields
directly, allowing us to rely on the ignore_missing option instead of adding
multiple conditions like [field] != null && [field] != '' for each processor.

@SimonKoetting SimonKoetting marked this pull request as ready for review July 10, 2025 14:11
@SimonKoetting SimonKoetting requested a review from a team as a code owner July 10, 2025 14:11
@andrewkroh andrewkroh added Integration:zscaler_zpa Zscaler Private Access Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels Jul 10, 2025
@elasticmachine
Copy link

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

@andrewkroh andrewkroh added the bugfix Pull request that fixes a bug issue label Jul 10, 2025
@elastic-vault-github-plugin-prod
Copy link

elastic-vault-github-plugin-prod bot commented Jul 10, 2025

🚀 Benchmarks report

Package zscaler_zpa 👍(5) 💚(0) 💔(0)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
app_connector_status 0 1572.33 1572.33 ( - %) 👍
audit 0 3937.01 3937.01 ( - %) 👍
browser_access 0 1814.88 1814.88 ( - %) 👍
user_activity 0 2958.58 2958.58 ( - %) 👍
user_status 0 5847.95 5847.95 ( - %) 👍

@SimonKoetting SimonKoetting requested a review from andrewkroh July 10, 2025 14:43
Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

I'm inclined to think that adding the guards on the affected processors would be a better approach rather than traversing the full document an extra time.

@SimonKoetting
Copy link
Contributor Author

/test benchmark fullreport

@elasticmachine
Copy link

💚 Build Succeeded

History

Copy link

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:zscaler_zpa Zscaler Private Access 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.

4 participants