allow patterns in journal queries (#16210)
Costa Tsaousis committed
Oct 16, 2023 at 00:24 UTC
7a3f22e24b428de258e4b55321aed75eac97b19e
3 files changed
+29
-29
collectors/systemd-journal.plugin/systemd-journal.c
+2
-2
@@ -179,7 +179,7 @@ int fstat64(int fd, struct stat64 *buf) {
179
"|_UID" \
180
"|_GID" \
181
"|_COMM" \
182
- /* "|_EXE" */ \
182
+ "|_EXE" \
183
/* "|_CMDLINE" */ \
184
"|_CAP_EFFECTIVE" \
185
/* "|_AUDIT_SESSION" */ \
@@ -218,7 +218,7 @@ int fstat64(int fd, struct stat64 *buf) {
218
"|OBJECT_UID" \
219
"|OBJECT_GID" \
220
"|OBJECT_COMM" \
221
- /* "|OBJECT_EXE" */ \
221
+ "|OBJECT_EXE" \
222
/* "|OBJECT_CMDLINE" */ \
223
/* "|OBJECT_AUDIT_SESSION" */ \
224
"|OBJECT_AUDIT_LOGINUID" \
database/rrdfunctions.c
+26
-26
@@ -38,17 +38,17 @@ static unsigned char functions_allowed_chars[256] = {
38
[30] = '_', //
39
[31] = '_', //
40
[32] = ' ', // SPACE keep
41
- [33] = '_', // !
42
- [34] = '_', // "
43
- [35] = '_', // #
44
- [36] = '_', // $
45
- [37] = '_', // %
46
- [38] = '_', // &
47
- [39] = '_', // '
48
- [40] = '_', // (
49
- [41] = '_', // )
50
- [42] = '_', // *
51
- [43] = '_', // +
41
+ [33] = '!', // ! keep
42
+ [34] = '"', // " keep
43
+ [35] = '#', // # keep
44
+ [36] = '$', // $ keep
45
+ [37] = '%', // % keep
46
+ [38] = '&', // & keep
47
+ [39] = '\'', // ' keep
48
+ [40] = '(', // ( keep
49
+ [41] = ')', // ) keep
50
+ [42] = '*', // * keep
51
+ [43] = '+', // + keep
52
[44] = ',', // , keep
53
[45] = '-', // - keep
54
[46] = '.', // . keep
@@ -64,12 +64,12 @@ static unsigned char functions_allowed_chars[256] = {
64
[56] = '8', // 8 keep
65
[57] = '9', // 9 keep
66
[58] = ':', // : keep
67
- [59] = ':', // ; convert ; to :
68
- [60] = '_', // <
69
- [61] = ':', // = convert = to :
70
- [62] = '_', // >
71
- [63] = '_', // ?
72
- [64] = '_', // @
67
+ [59] = ';', // ; keep
68
+ [60] = '<', // < keep
69
+ [61] = '=', // = keep
70
+ [62] = '>', // > keep
71
+ [63] = '?', // ? keep
72
+ [64] = '@', // @ keep
73
[65] = 'A', // A keep
74
[66] = 'B', // B keep
75
[67] = 'C', // C keep
@@ -96,12 +96,12 @@ static unsigned char functions_allowed_chars[256] = {
96
[88] = 'X', // X keep
97
[89] = 'Y', // Y keep
98
[90] = 'Z', // Z keep
99
- [91] = '_', // [
100
- [92] = '/', // backslash convert \ to /
101
- [93] = '_', // ]
102
- [94] = '_', // ^
99
+ [91] = '[', // [ keep
100
+ [92] = '\\', // backslash keep
101
+ [93] = ']', // ] keep
102
+ [94] = '^', // ^ keep
103
[95] = '_', // _ keep
104
- [96] = '_', // `
104
+ [96] = '`', // ` keep
105
[97] = 'a', // a keep
106
[98] = 'b', // b keep
107
[99] = 'c', // c keep
@@ -128,10 +128,10 @@ static unsigned char functions_allowed_chars[256] = {
128
[120] = 'x', // x keep
129
[121] = 'y', // y keep
130
[122] = 'z', // z keep
131
- [123] = '_', // {
132
- [124] = '_', // |
133
- [125] = '_', // }
134
- [126] = '_', // ~
131
+ [123] = '{', // { keep
132
+ [124] = '|', // | keep
133
+ [125] = '}', // } keep
134
+ [126] = '~', // ~ keep
135
[127] = '_', //
136
[128] = '_', //
137
[129] = '_', //
libnetdata/facets/facets.c
+1
-1
@@ -1458,7 +1458,7 @@ void facets_set_query(FACETS *facets, const char *query) {
1458
if(!query)
1459
return;
1460
1461
- facets->query = simple_pattern_create(query, " \t", SIMPLE_PATTERN_SUBSTRING, false);
1461
+ facets->query = simple_pattern_create(query, "|", SIMPLE_PATTERN_SUBSTRING, false);
1462
}
1463
1464
void facets_set_items(FACETS *facets, uint32_t items) {