Skip to content

Commit f46ffac

Browse files
committed
use proper bytes in pixiu
1 parent 44d7879 commit f46ffac

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

tests/data/pixiu

+10-10
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ data = [
147147
"alarm_severity": "Major",
148148
"alarm_object": "OceanStor-Distributed-Storage",
149149
"alarm_id": "0xFEA6A000B",
150-
"used_space": 1024000000,
150+
"used_space": 1073741824,
151151
"quota_used_type": "space",
152152
"quota_type": "directory",
153153
"dtree": "test1",
154154
"dtree_id": 4101,
155155
"namespace": "admin",
156156
"namespace_id": 71,
157157
"quota_limit_type": "hard",
158-
"quota_space_limit": 1024000000,
158+
"quota_space_limit": 1073741824,
159159
"path": "/",
160160
},
161161
},
@@ -167,7 +167,7 @@ data = [
167167
"alarm_severity": "Major",
168168
"alarm_object": "OceanStor-Distributed-Storage",
169169
"alarm_id": "0xFEA6A000F",
170-
"used_space": 6638000000,
170+
"used_space": 6960447488,
171171
"quota_used_type": "space",
172172
"quota_type": "user",
173173
"username": "vsc10042",
@@ -176,7 +176,7 @@ data = [
176176
"namespace": "user",
177177
"namespace_id": 70,
178178
"quota_limit_type": "soft",
179-
"quota_space_limit": 6144000000,
179+
"quota_space_limit": 6442450944,
180180
"path": "/100",
181181
},
182182
},
@@ -228,11 +228,11 @@ data = [
228228
"namespace_id": 242,
229229
"dtree": "--",
230230
"dtree_id": 0,
231-
"used_space": 18000000,
231+
"used_space": 18874368,
232232
"quota_used_type": "space",
233233
"quota_type": "directory",
234234
"quota_limit_type": "soft",
235-
"quota_space_limit": 15000000,
235+
"quota_space_limit": 15728640,
236236
"path": "/",
237237
},
238238
},
@@ -245,11 +245,11 @@ data = [
245245
"namespace_id": 182,
246246
"dtree": "--",
247247
"dtree_id": 0,
248-
"used_space": 8388608000000,
248+
"used_space": 8796093022208,
249249
"quota_used_type": "space",
250250
"quota_type": "directory",
251251
"quota_limit_type": "hard",
252-
"quota_space_limit": 8388608000000,
252+
"quota_space_limit": 8796093022208,
253253
"path": "/",
254254
},
255255
},
@@ -299,8 +299,8 @@ data = [
299299
"namespace_id": 70,
300300
"quota_limit_type": "soft",
301301
"path": "/110",
302-
"quota_space_limit": 5851000000,
303-
"used_space": 6108000000,
302+
"quota_space_limit": 6135218176,
303+
"used_space": 6404702208,
304304
},
305305
},
306306
{

tests/logstash_7.6.2.conf

+10-4
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)