gcl No matching signature for operator ~ for argument types: STRING. Supported signatures: ~(INT64)

112 Views Asked by At

When I try the following query in google cloud log analytics

SELECT
   http_request.user_agent,count(*) as num
FROM
  `tympa-health-production.global._Default._AllLogs`
WHERE
  http_request.user_agent as string =~ "^google.*"

I get

No matching signature for operator ~ for argument types: STRING. Supported signatures: ~(INT64)

also tried

cast(http_request.user_agent as string) =~ "^google.*"

any ideas?

1

There are 1 best solutions below

0
On

This looks like a cloud Log Analytics query, I got the inquiry running with mine adding @Samuel recommendation:

SELECT http_request.user_agent,count(*) as num 
FROM `tympa-health-production.global._Default._AllLogs` 
WHERE cast(http_request.user_agent as string) like "google.%" Group by http_request.user_agent

But got null result possibly because there is nothing at my sink at the moment.