Do you guys know if there is a function in osquery...
# macos
t
Do you guys know if there is a function in osquery to get a substring ? substr exists in sqlite, but it seems like osquery doesn't like it.
z
The normal
substr
function works.
Copy code
osqueryi "SELECT substr('SQLite substr', 1, 6);"
+-------------------------------+
| substr('SQLite substr', 1, 6) |
+-------------------------------+
| SQLite                        |
+-------------------------------+
t
yeah, I think the problem might be from fleetdm, not osquery. Thanks anyway
z
If there might be a problem in Fleet, would love to understand and fix that. Anything supported in osquery should be supported also in Fleet.
t
The problem is when I execute the query I get an error right away "Something has gone wrong. Please try again" Usually if it's syntax issue I get an error saying what was wrong with the syntax, but this error is weird. Fleetdm logs doesn't show anything about it and neither the workstation that the query was supposed to be execute on.
z
Can you open the network inspector in the browser and see what the response is from the Fleet server?
FWIW that query works in Fleet for me
t
oh great idea, haven't thought about using the network inspector to check the response.
Thanks for the tip. It turned out that cloudflare is the one blocking the query.
z
Oh wow very interesting. Cloudflare blocks only that query?
t
Cloudflare blocks certain queries that think it's a SQL injection. I've had this problem with other functions as well.
ty 1