-
Notifications
You must be signed in to change notification settings - Fork 1.7k
utils: plugins: Provide a choice for encoding raw UTF-8 strings #10665
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
cosmo0920
wants to merge
60
commits into
master
Choose a base branch
from
cosmo0920-provide-raw-utf8-choice
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
0c8557f
utils: Add option for esacape_unicode for choices raw utf-8 or not
cosmo0920 39bdff7
config: Introduce new config for determine whether escaping unicode o…
cosmo0920 1fa31c5
pack: Handle escape_unicode arguments
cosmo0920 657b519
sds: Follow the argument increase
cosmo0920 55fc283
help: Follow the argument increase
cosmo0920 3e9d173
record_accessor: Follow the argument change
cosmo0920 1b0254b
bin: Follow the argument change
cosmo0920 911d6b4
http_server: Follow to use escape_unicode argument
cosmo0920 ba3d251
filter_expect: Follow to use escape_unicode argument
cosmo0920 eb7e3ee
filter_nightfall: Follow to use escape_unicode argument
cosmo0920 e02505d
filter_wasm: Refer the config whether escaping unicode characters or not
cosmo0920 8c621a1
out_azure: Refer the config whether esacaping unicode or not in JSON
cosmo0920 8dea115
out_azure_logs_ingestion: Refer to use a config whether escaping unic…
cosmo0920 f0aee47
out_bigquery: Refer a config whether escaping unicode or not in JSON
cosmo0920 5a5c5ff
out_calyptia: Use a flag always to escape unicode
cosmo0920 cf08efe
out_chronicle: Refer to use a config whether escaping unicode or not …
cosmo0920 fadc65f
out_cloudwatch: Refer a config whether escaping unicode or not in JSON
cosmo0920 db51b5b
out_datadog: Refer a config whether escaping unicode or not in JSON
cosmo0920 a620810
out_es: Refer a config whether escaping unicode or not in JSON
cosmo0920 4da7fb6
out_http: Refer a config whether escaping unicode or not in JSON
cosmo0920 5e7ebec
out_influxdb: Refer a config whether escaping unicode or not in JSON
cosmo0920 cbcf5f3
out_kafka: Refer a config whether escaping unicode or not in JSON
cosmo0920 ace09f2
out_kafka_rest: Refer a config whether escaping unicode or not in JSON
cosmo0920 1759a86
out_kinesis_firehose: Refer a config whether escaping unicode or not …
cosmo0920 02dc227
out_kinesis_streams: Refer a config whether escaping unicode or not i…
cosmo0920 cb2a2fe
out_lib: Refer a config whether escaping unicode or not in JSON
cosmo0920 b9f574b
out_logdna: Refer a config whether escaping unicode or not in JSON
cosmo0920 6b2b124
out_loki: Refer a config whether escaping unicode or not in JSON
cosmo0920 7a546b9
out_nats: Refer a config whether escaping unicode or not in JSON
cosmo0920 86f4e4a
out_nrlogs: Refer a config whether escaping unicode or not in JSON
cosmo0920 9656e32
out_null: Refer a config whether escaping unicode or not in JSON
cosmo0920 f86c497
out_opensearch: Refer a config whether escaping unicode or not in JSON
cosmo0920 d88019d
out_oracle_log_ayalysis: Refer a config whether escaping unicode or n…
cosmo0920 6774067
out_s3: Refer a config whether escaping unicode or not in JSON
cosmo0920 c114453
out_skywalking: Refer a config whether escaping unicode or not in JSON
cosmo0920 0114c3d
out_slack: Refer a config whether escaping unicode or not in JSON
cosmo0920 a93036c
out_splunk: Refer a config whether escaping or not in JSON
cosmo0920 4496b27
out_stackdriver: Refer a config whether escaping unicode or not in JSON
cosmo0920 ff5c9c5
out_stdout: Refer a config whether escaping unicode or not in JSON
cosmo0920 a61f096
out_tcp: Refer a config whether escaping unicode or not in JSON
cosmo0920 2e027b7
out_udp: Refer a config whether escaping unicode or not in JSON
cosmo0920 a105cee
out_vivo: Refer a config whether escaping unicode or not in JSON
cosmo0920 5259021
out_websocket: Refer a config whether escaping unicode or not in JSON
cosmo0920 838aab3
processor_content_modifier: Follow the argument increase
cosmo0920 3b58061
tests: log_event_decoder: Follow an increase of argument
cosmo0920 bc185e6
tests: mp: Follow an increase of argument
cosmo0920 f37d644
tests: msgpack_append_message: Follow an increase of argument
cosmo0920 d08d6d6
tests: opnentelemetry: Follow an increase of argument
cosmo0920 da2fd8a
tests: pack: Follow an increase of argument
cosmo0920 2f377ab
tests: stream_processor: Follow an increase of argument
cosmo0920 f96fb0d
tests: filter_lua: Follow an increase of argument
cosmo0920 cef6c8e
tests: in_opentelemetry: Follow an increase of argument
cosmo0920 b4b06af
utils: Optimize raw string function with SIMD
cosmo0920 02a902b
tests: utils: Add test case for encoding raw UTF-8 strings
cosmo0920 1336593
in_systemd: Follow an increase of argument
cosmo0920 49733c2
pack: Avoid to use hard-coded value for escaping strings
cosmo0920 b0f40da
out_pqsql: Follow an increase of argument
cosmo0920 3cbe15f
tests: fuzzer: Follow an increase of argument
cosmo0920 6f767a8
tests: fuzzer: Follow an increase of argument
cosmo0920 5ede613
tests: fuzzer: Follow an increase of argument
cosmo0920 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -311,7 +311,7 @@ static flb_sds_t get_agent_metadata(struct flb_calyptia *ctx) | |
flb_mp_map_header_end(&mh); | ||
|
||
/* convert to json */ | ||
meta = flb_msgpack_raw_to_json_sds(mp_sbuf.data, mp_sbuf.size); | ||
meta = flb_msgpack_raw_to_json_sds(mp_sbuf.data, mp_sbuf.size, FLB_TRUE); /* could be ASCII */ | ||
msgpack_sbuffer_destroy(&mp_sbuf); | ||
|
||
return meta; | ||
|
@@ -532,7 +532,7 @@ static int store_session_get(struct flb_calyptia *ctx, | |
} | ||
|
||
/* decode */ | ||
json = flb_msgpack_raw_to_json_sds(buf, size); | ||
json = flb_msgpack_raw_to_json_sds(buf, size, FLB_TRUE); /* TODO: could be ASCII? */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we resolve this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure but the current pattern of usages do not have multibytes between the dedicated service and this plugin. |
||
flb_free(buf); | ||
if (!json) { | ||
return -1; | ||
|
@@ -1029,7 +1029,8 @@ static void cb_calyptia_flush(struct flb_event_chunk *event_chunk, | |
event_chunk->size, | ||
FLB_PACK_JSON_FORMAT_STREAM, | ||
FLB_PACK_JSON_DATE_DOUBLE, | ||
NULL); | ||
NULL, | ||
FLB_TRUE); /* Trace is ASCII */ | ||
if (json == NULL) { | ||
flb_upstream_conn_release(u_conn); | ||
FLB_OUTPUT_RETURN(FLB_RETRY); | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing NULL-check before dereferencing
config
config
is assumed non-NULL when accessingconfig->json_escape_unicode
. The engine passes a valid pointer in normal paths, but defensive code would make the function robust to accidental NULLs or future refactors.🤖 Prompt for AI Agents