Skip to content

Commit

Permalink
fix: escape google cloud logging query
Browse files Browse the repository at this point in the history
  • Loading branch information
srevinsaju committed Mar 31, 2023
1 parent 2fe9b33 commit de8d3bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion infrastructure/clouds/togomak.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package clouds
import (
"fmt"
"gitlab.com/sorcero/community/go-cat/infrastructure"
"net/url"
"time"
)

Expand Down Expand Up @@ -36,7 +37,7 @@ var togomakInfrastructureMetadata = Metadata{
}

query := "jsonPayload.labels.stage = \"%s\"\nlabels.instanceId = \"%s\";timeRange=%s/%s--PT24H;"
query = fmt.Sprintf(query, stage, instanceID, m.DeployedOn.Format(time.RFC3339Nano), m.DeployedOn.Format(time.RFC3339Nano))
query = url.PathEscape(fmt.Sprintf(query, stage, instanceID, m.DeployedOn.Format(time.RFC3339Nano), m.DeployedOn.Format(time.RFC3339Nano)))

return fmt.Sprintf("https://console.cloud.google.com/logs/query;query=%s?project=%s", query, m.CloudProjectId)
},
Expand Down

0 comments on commit de8d3bc

Please sign in to comment.