Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing doesn't work #8

Open
yamamoto52 opened this issue Jan 27, 2020 · 1 comment · May be fixed by #15
Open

testing doesn't work #8

yamamoto52 opened this issue Jan 27, 2020 · 1 comment · May be fixed by #15

Comments

@yamamoto52
Copy link

in few last lines I have problem :

export TIMESTAMP=$(date -d "-2 hour"  +%Y-%m-%dT%k:%M:00Z)
export BATCH_ID=$(gcloud logging read "resource.type=\"gae_app\" AND resource.labels.module_id=\"list-metrics\" AND logName=\"projects/$PROJECT_ID/logs/appengine.googleapis.com%2Frequest_log\" AND protoPayload.line.logMessage:\"batch_id:\" AND timestamp >= \"$TIMESTAMP\"" --limit 1 --format json | grep "batch_id:" | awk '{ print substr($3,1,32); }')

output from second line is :

ERROR: (gcloud.logging.read) INVALID_ARGUMENT: The value '2020-01-27t 8:05:00z' is of incorrect type.
@tzehon
Copy link
Contributor

tzehon commented Jan 19, 2021

I had this error too. I experimented a bit and it seems like the error arises because the query syntax doesn't recognize the white space between the date and the time.

Instead of "%k", can you try "%H"? the command would then look like :export TIMESTAMP=$(date -d "-2 hour" +%Y-%m-%dT%H:%M:00Z). I tried this in Cloud Shell and the Log Explorer and it did return me results in the next step when saving to the BATCH_ID.

@gojanpaolo gojanpaolo linked a pull request May 7, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants