我在 Splunk 中有一些日志事件,如下所示:
Payment request to app_name_foo for brand: B1, app_id: A1, some param: blah, another param: blahblahblah, payment method: CREDITCARD, last param: someuniquestring
Payment request to app_name_foo for brand: B1, app_id: A2, some param: blah, another param: blahblahblah, payment method: GPAY, last param: someuniquestring
Payment request to app_name_foo for brand: B2, app_id: A3, some param: blah, another param: blahblahblah, payment method: GPAY, last param: someuniquestring
Payment request to app_name_foo for brand: B2, app_id: A1, some param: blah, another param: blahblahblah, payment method: CREDITCARD, last param: someuniquestring
Payment request to app_name_foo for brand: B2, app_id: A4, some param: blah, another param: blahblahblah, payment method: GPAY, last param: someuniquestring
我正在尝试获取如下表:
BRAND | CREDITCARD | DIRECTDEBIT | GPAY
B1 | 1 | 0 | 1
B2 | 1 | 0 | 2
到目前为止我已经尝试过:
index = app_name_foo sourcetype = app "Payment request to app_name_foo for brand"
| chart count over brand by method
index = app_name_foo sourcetype = app "Payment request to app_name_foo for brand"
| chart count over brand by "payment method"
index = app_name_foo sourcetype = app "Payment request to app_name_foo for brand"
| chart count(eval(method==CREDITCARD)) AS CREDITCARD count(eval(method==DIRECTDEBIT)) AS DIRECTDEBIT count(eval(method==GPAY )) AS GPAY by brand
不幸的是,Splunk 似乎无法识别付款方式或方法。上面的查询(以及我在互联网上找到的更多查询)没有产生任何结果。
如果我用app_id替换方法或付款方式,那么我会得到一些结果。
我错过了什么?请帮忙。