How to use the UI to create search filters for the /system/logs/search API endpoint

I’m using the /system/logs/search endpoint to filter for custom events within the access.log file.

  • Filters work properly via log search in the UI

  • My filter experience with the API is still clumsy and time consuming

Is there a way to quickly generate a custom search query that can be used with the log search endpoint from the UI?

As with a lot of Modern Web Applications, the Network Dev Tools of your browser is pretty awesome for seeing Client Side API requests / responses. So in my example, I used the GUI to search for logs while the Network tools are open. Once I submit the Search, I can see the API Request. From there, I can right click on the Entry > Copy > Copy as cURL - which builds the cURL request (Including all the headers, and body, etc). You can then use that in your terminal to play around with the API.

Example GIF: Large GIF (1910x2024) - Gifyu