umami icon indicating copy to clipboard operation
umami copied to clipboard

Support wildcard filters

Open artfulrobot opened this issue 2 years ago • 6 comments

I'm offering this here for discussion, as requested by @MariusVB; not as a "please merge this now". If it's unhelpful, please just close. There's a lot I don't know about this project.

There's 2 commits, neither is tested.

  1. 4389fd72c2b751862482a47dc9fa16bd03ae5821 Support the LIKE operator. This seems like it might be a way to offer a LIKE operator at the query level. It doesn't expose it in the UI, but perhaps it means there's a way to manually construct a URL, which might enable the feature for technically capable types who just need the feature in a hurry for certain reports. This code might work, and it might be simple enough to add LIKE to the UI.

  2. 5b7e38234791f2ebbc44d1811c63260e50f8c06c Support automatically using the LIKE operator (as opposed to equals) if the input contains * character(s). This commit is likely highly contentious, and probably not what is wanted long term, if at all! It might not work anyway; I'm not sure how mutable the filters object is.

artfulrobot avatar Oct 26 '23 09:10 artfulrobot

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
umami-analytics-us ⬜️ Ignored (Inspect) Visit Preview Oct 26, 2023 9:52am

vercel[bot] avatar Oct 26 '23 09:10 vercel[bot]

@artfulrobot is attempting to deploy a commit to the umami-software Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Oct 26 '23 09:10 vercel[bot]

@MariusVB (in case @ ing within a link does not work!)

artfulrobot avatar Oct 26 '23 09:10 artfulrobot

@mikecao - could we add wildcard filters like this? It would be extremely useful. If you have a page like this: /foo/:id/smth /foo/:id/bar /foo/:id/fubar

It would be useful to be able to count pageviews like /foo/:id/* instead of having to make N requests for each foo/:id .

MariusVB avatar Oct 31 '23 08:10 MariusVB

@MariusVB What do you want to query there? I think this would be solved by the LIKE operator.

  • LIKE "/foo/%/smth" would match /foo/a/smth and /foo/b/smth ...
  • LIKE "/foo/%" would match /foo/a/smthand/foo/b/smthand/foo/a/barand/foo/z/fubar`
  • LIKE "/foo/123/%" would match /foo/123/smth and /foo/123/bar ...

artfulrobot avatar Oct 31 '23 09:10 artfulrobot

We ended up querying the analytics db directly, instead of using the API.

MariusVB avatar Nov 22 '23 15:11 MariusVB

Latest version now supports contains logic.

mikecao avatar May 03 '24 06:05 mikecao