I am trying to use variables in "startsAt": and "endsAt ",
but I get the error parsing.
Moreover, if I substitute the output of variables, there are no errors.
$mydate1=`
date -u +"%Y-%m-%dT%H:%M:%SZ" `
$mydate2=`
date -u +"%Y-%m-%dT%H:%M:%SZ" --date '4 hours'
`
Example:
curl
http://localhost:9093/api/v1/silences -d '{
"matchers": [
{
"name": "instance",
"value": "host1:9100",
"isRegex": true
}
],
"startsAt": "$mydate1",
"endsAt": "$mydate2",
"createdBy": "api",
"comment": "Silence",
"status": {
"state": "active"
}
}'