#community-help

Logging User Search Queries with Sensitive Data

TLDR J asked for methods to log user search queries. Jason suggested instrumenting the frontend app but J preferred duplicating http requests due to sensitive data.

Powered by Struct AI

2

1

Sep 21, 2022 (15 months ago)
J
Photo of md5-66aa3358ebe0dc506bd264f45bf4e2c7
J
10:29 PM
Hi anyone know a way to have audit logs on search queries done by users?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
10:30 PM
You would have to instrument your frontend app to collect the search queries that users type into the textbox, and send the data into your analytics tool

1

10:30
Jason
10:30 PM

1

J
Photo of md5-66aa3358ebe0dc506bd264f45bf4e2c7
J
10:39 PM
Makes sense, but we're working with sensitive data and there's a slight chance advanced users can easily mess up with that front-end based tracking. I think a possible solution for us is to mirror / duplicate the http requests sent to typesense, sending a copy of it to our logging servers. I think HAProxy / NGINX / Traefik can help us on that. Thanks for the idea!
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
10:39 PM
Yup, that’s another way to do it

1