Skip to content

Commit 9f8c816

Browse files
cosmo0920edsiper
authored andcommitted
in_syslog: tests: Use format instead of frame
The term of frame is a bit of low level concept for users. Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent 16e2dd8 commit 9f8c816

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

plugins/in_syslog/syslog.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ static struct flb_config_map config_map[] = {
245245
"Key where the source address will be injected"
246246
},
247247
{
248-
FLB_CONFIG_MAP_STR, "frame", (char *) NULL,
249-
0, FLB_TRUE, offsetof(struct flb_syslog, frame_str),
250-
"TCP framing: newline (default) or octet_counting (RFC 6587)"
248+
FLB_CONFIG_MAP_STR, "format", (char *) NULL,
249+
0, FLB_TRUE, offsetof(struct flb_syslog, format_str),
250+
"Format of TCP framing: newline (default) or octet_counting (RFC 6587)"
251251
},
252252

253253
/* EOF */

plugins/in_syslog/syslog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct flb_syslog {
7272
flb_sds_t source_address_key;
7373

7474
/* TCP framing */
75-
flb_sds_t frame_str;
75+
flb_sds_t format_str;
7676
int frame_type;
7777

7878
int dgram_mode_flag;

plugins/in_syslog/syslog_conf.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ struct flb_syslog *syslog_conf_create(struct flb_input_instance *ins,
109109

110110
/* TCP Frame type (only applies to stream modes; default newline) */
111111
ctx->frame_type = FLB_SYSLOG_FRAME_NEWLINE;
112-
if (ctx->frame_str != NULL) {
113-
if (strcasecmp(ctx->frame_str, "octet_counting") == 0 ||
114-
strcasecmp(ctx->frame_str, "octet") == 0) {
112+
if (ctx->format_str != NULL) {
113+
if (strcasecmp(ctx->format_str, "octet_counting") == 0 ||
114+
strcasecmp(ctx->format_str, "octet") == 0) {
115115
ctx->frame_type = FLB_SYSLOG_FRAME_OCTET_COUNTING;
116116
}
117-
else if (strcasecmp(ctx->frame_str, "newline") != 0) {
117+
else if (strcasecmp(ctx->format_str, "newline") != 0) {
118118
flb_plg_warn(ins, "[in_syslog] unknown frame '%s', using 'newline'",
119-
ctx->frame_str);
119+
ctx->format_str);
120120
}
121121
}
122122

tests/runtime/in_syslog.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ void flb_test_syslog_tcp_octet_counting()
10911091

10921092
ret = flb_input_set(ctx->flb, ctx->i_ffd,
10931093
"mode", "tcp",
1094-
"frame", "octet_counting",
1094+
"format", "octet_counting",
10951095
"parser", PARSER_NAME_RFC5424,
10961096
NULL);
10971097
TEST_CHECK(ret == 0);
@@ -1154,7 +1154,7 @@ void flb_test_syslog_tcp_octet_counting_lf()
11541154

11551155
ret = flb_input_set(ctx->flb, ctx->i_ffd,
11561156
"mode", "tcp",
1157-
"frame", "octet_counting",
1157+
"format", "octet_counting",
11581158
"parser", PARSER_NAME_RFC5424,
11591159
NULL);
11601160
TEST_CHECK(ret == 0);
@@ -1221,7 +1221,7 @@ void flb_test_syslog_tcp_octet_counting_fragmented()
12211221

12221222
ret = flb_input_set(ctx->flb, ctx->i_ffd,
12231223
"mode", "tcp",
1224-
"frame", "octet_counting",
1224+
"format", "octet_counting",
12251225
"parser", PARSER_NAME_RFC5424,
12261226
NULL);
12271227
TEST_CHECK(ret == 0);
@@ -1299,7 +1299,7 @@ void flb_test_syslog_tcp_octet_counting_multi()
12991299

13001300
ret = flb_input_set(ctx->flb, ctx->i_ffd,
13011301
"mode", "tcp",
1302-
"frame", "octet_counting",
1302+
"format", "octet_counting",
13031303
"parser", PARSER_NAME_RFC5424,
13041304
NULL);
13051305
TEST_CHECK(ret == 0);

0 commit comments

Comments
 (0)