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

enhancement(gcp_chronicle sink): Add default fallback logic if log_type template cannot be resolved fo… #22323

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ArunPiduguDD
Copy link
Contributor

@ArunPiduguDD ArunPiduguDD commented Jan 29, 2025

Summary

Similar to changes made for the Elasticsearch and Object Storage sinks

Currently, the Google Chronicle sink has the option to specify an log_type to attach to events. This field supports template syntax, however if the template is not able to be resolved, the default behavior is to drop the event.

Adding an optional field that specifies a default fallback log_type that can be used if there is a template rendering error.

Testing

Tested using Vector pipeline with a Google Chronicle sink

@github-actions github-actions bot added the domain: sinks Anything related to the Vector's sinks label Jan 29, 2025
@ArunPiduguDD ArunPiduguDD changed the title enhancement(google chronicle sink): Add default fallback logic if log_type template cannot be resolved fo… enhancement(gcp_chronicle sink): Add default fallback logic if log_type template cannot be resolved fo… Jan 30, 2025
@ArunPiduguDD ArunPiduguDD force-pushed the add-google-chronicle-unresolved-log-type-template-default-fallback branch from 40d8e47 to 25f0f17 Compare January 30, 2025 17:01
@pront
Copy link
Member

pront commented Jan 30, 2025

Hey @ArunPiduguDD, do you need a review on this? It's marked as a draft but I am getting notifications because you tagged me as a reviewer. Happy to review when it's ready.

@ArunPiduguDD ArunPiduguDD marked this pull request as ready for review January 30, 2025 17:07
@ArunPiduguDD ArunPiduguDD requested a review from a team as a code owner January 30, 2025 17:07
@ArunPiduguDD
Copy link
Contributor Author

Hey @ArunPiduguDD, do you need a review on this? It's marked as a draft but I am getting notifications because you tagged me as a reviewer. Happy to review when it's ready.

@pront Just marked it as ready for review

@datadog-vectordotdev
Copy link

datadog-vectordotdev bot commented Jan 30, 2025

Datadog Report

Branch report: add-google-chronicle-unresolved-log-type-template-default-fallback
Commit report: 4bf3322
Test service: vector

✅ 0 Failed, 7 Passed, 0 Skipped, 25.49s Total Time

@ArunPiduguDD ArunPiduguDD requested review from a team as code owners January 30, 2025 18:09
@github-actions github-actions bot added the domain: external docs Anything related to Vector's external, public documentation label Jan 30, 2025
src/sinks/gcp_chronicle/chronicle_unstructured.rs Outdated Show resolved Hide resolved
pub struct ChroniclePartitioner(Template, Option<Template>);
pub struct ChroniclePartitioner {
log_type: Template,
template_fallback_log_type: Option<String>,
Copy link
Member

Choose a reason for hiding this comment

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

Nit:

Suggested change
template_fallback_log_type: Option<String>,
fallback_log_type: Option<String>,

Is this intentionally a String and not a Template?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, it's the fallback option if the log_type template can't be resolved, similar to this Elasticsearch change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: external docs Anything related to Vector's external, public documentation domain: sinks Anything related to the Vector's sinks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants