Skip to content

Commit 02901c0

Browse files
committed
use proper bytes in pixiu
1 parent 645bf56 commit 02901c0

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

tests/data/pixiu

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,15 @@ data = [
167167
"alarm_severity": "Major",
168168
"alarm_object": "OceanStor-Distributed-Storage",
169169
"alarm_id": "0xFEA6A000B",
170-
"used_space": 1024000000,
170+
"used_space": 1073741824,
171171
"quota_used_type": "space",
172172
"quota_type": "directory",
173173
"dtree": "test1",
174174
"dtree_id": 4101,
175175
"namespace": "admin",
176176
"namespace_id": 71,
177177
"quota_limit_type": "hard",
178-
"quota_space_limit": 1024000000,
178+
"quota_space_limit": 1073741824,
179179
"path": "/",
180180
},
181181
},
@@ -187,7 +187,7 @@ data = [
187187
"alarm_severity": "Warning",
188188
"alarm_object": "OceanStor-Distributed-Storage",
189189
"alarm_id": "0xFEA6A000F",
190-
"used_space": 8191000000,
190+
"used_space": 8588886016,
191191
"quota_used_type": "space",
192192
"quota_type": "user",
193193
"username": "vsc10042",
@@ -196,7 +196,7 @@ data = [
196196
"namespace": "user",
197197
"namespace_id": 70,
198198
"quota_limit_type": "soft",
199-
"quota_space_limit": 6144000000,
199+
"quota_space_limit": 6442450944,
200200
"path": "/100",
201201
},
202202
},
@@ -269,11 +269,11 @@ data = [
269269
"namespace_id": 242,
270270
"dtree": "--",
271271
"dtree_id": 0,
272-
"used_space": 18000000,
272+
"used_space": 18874368,
273273
"quota_used_type": "space",
274274
"quota_type": "directory",
275275
"quota_limit_type": "soft",
276-
"quota_space_limit": 15000000,
276+
"quota_space_limit": 15728640,
277277
"path": "/",
278278
},
279279
},
@@ -286,11 +286,11 @@ data = [
286286
"namespace_id": 182,
287287
"dtree": "--",
288288
"dtree_id": 0,
289-
"used_space": 8388608000000,
289+
"used_space": 8796093022208,
290290
"quota_used_type": "space",
291291
"quota_type": "directory",
292292
"quota_limit_type": "hard",
293-
"quota_space_limit": 8388608000000,
293+
"quota_space_limit": 8796093022208,
294294
"path": "/",
295295
},
296296
},
@@ -340,8 +340,8 @@ data = [
340340
"namespace_id": 70,
341341
"quota_limit_type": "soft",
342342
"path": "/110",
343-
"quota_space_limit": 5851000000,
344-
"used_space": 6108000000,
343+
"quota_space_limit": 6135218176,
344+
"used_space": 6404702208,
345345
},
346346
},
347347
{

tests/logstash_7.6.2.conf

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ filter {
3737
}
3838
}
3939

40-
if ("_grokparsefailure" not in [tags]) {
41-
mutate {
42-
remove_field => [ "syslog_hostname", "syslog_message", "syslog_timestamp", "KEY_EQ_VALUEDATA" ]
43-
}
40+
if "_grokparsefailure" not in [tags] {
41+
mutate {
42+
# in the future remove the field 'message' too
43+
remove_field => [ "syslog_hostname", "syslog_message", "syslog_timestamp", "KEY_EQ_VALUEDATA", "int" ]
44+
convert => { "success" => "boolean" }
45+
46+
# we need MB converted to MiB for bytes2human
47+
gsub => [ "used_space", "([0-9]+[kKmMgGtTpP])[bB]", "\1ib",
48+
"quota_space_limit", "([0-9]+[kKmMgGtTpP])[bB]", "\1ib" ]
49+
}
4450
}
4551

4652
if [jube_id] {

0 commit comments

Comments
 (0)