This should be easy. I'm building a query:
index=asdf "search string" | rex field=_raw mode=sed "s/.*foo(.*?)bar/\1/"
Great. Now it returns a portion of the log that I want to see. I need to "count and group" that now.
index=asdf "search string" | rex field=_raw mode=sed "s/.*foo(.*?)bar/\1/" | stats count by _raw
Hmm. That just returns raw counts, but not the data. Forcing it causes nothing to return:
index=asdf "search string" | rex field=_raw mode=sed "s/.*foo(.*?)bar/\1/" | stats count by _raw as dcount | fields _raw
So, given the first query, can someone add "count and group, sort by top counts" to it? Yes, I know this can theoretically be a field extraction, but I don't want that in this case.
... View more