Skip to content

celfmt: avoid truncating output file on -agent error - #110

Open
efd6 wants to merge 1 commit into
masterfrom
no_clobber_on_error
Open

celfmt: avoid truncating output file on -agent error#110
efd6 wants to merge 1 commit into
masterfrom
no_clobber_on_error

Conversation

@efd6

@efd6 efd6 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

When -o is used and formatting fails, os.Create had already truncated the output file before the error was detected. Buffer the formatted output in memory and only create the output file on success.

Also replace log.Fatal with log.Printf + return so the exit goes through Main rather than bypassing it.

When -o is used and formatting fails, os.Create had already truncated
the output file before the error was detected. Buffer the formatted
output in memory and only create the output file on success.

Also replace log.Fatal with log.Printf + return so the exit goes through
Main rather than bypassing it.
@efd6 efd6 self-assigned this Aug 26, 2026
@efd6
efd6 requested a review from a team as a code owner August 26, 2026 05:23
@efd6 efd6 added the Team:Security-Service Integrations Security Service Integrations Team [elastic/security-service-integrations] label Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant