Hello, I have a raw like this:
.success [{"importo":2,"tipologiaOperazione":"AAA"},{"importo":1.82,"tipologiaOperazione":"BBB"}, {"importo":1,"tipologiaOperazione":"AAA"}]
I need to have the sum of importo, by tipologiaOperazione, in this case, the result will be:
AAA: 3
BBB: 1.82
How can I do that?
I tried with this regex
| rex max_match=100000 "(?ms)(?P<importoDistinta>(?<=\"importo\":)(\\d*\\.?\\d*)(?=,))" | rex max_match=100000 "(?ms)(?P<tipologiaOperazione>(?<=\"tipologiaOperazione\":\")(\\w*\\s*\\w*\\w*\\s*\\w*)(?=\",))" | stats sum(importoDistinta) by tipologiaOperazione
but I've got this result:
AAA: 4.82
BBB: 4.82
... View more