I don’t think the new format w/“path” attribute is working. There’s no error in the CLI, but the web UI indicates that it “Failed to parse log format string” that was added via the CLI API.
I’ve attempted to copy-and-paste the log format string from Log streaming: Sumo Logic . (I tried clicking the “copy” button, but it doesn’t work. A toast modal indicates “copied to clipboard”, but nothing happens. I’m using MS EdgeDev and have added similar clipboard features to my web applications, so I’m not sure why it’s not working for me from the Fastly website.)
Here’s the command line:
fastly.exe logging sumologic create --service-id=%SITEID% --name="%LOGNAME%" --url="%COLLECTORURL%" --version latest --message-type=blank --autoclone --format=./sumologic-test.txt
and it creates a log entry that appears to be correct, but it can’t be parsed. (???)
Here’s the “sumologic-test.txt” file that I’m using in my test. It matches the content from the Fastly documentation for Sumo Logic.
{
"timestamp": "%{strftime(\{"%Y-%m-%dT%H:%M:%S%z"\}, time.start)}V",
"client_ip": "%{req.http.Fastly-Client-IP}V",
"geo_country": "%{client.geo.country_name}V",
"geo_city": "%{client.geo.city}V",
"host": "%{if(req.http.Fastly-Orig-Host, req.http.Fastly-Orig-Host, req.http.Host)}V",
"url": "%{json.escape(req.url)}V",
"request_method": "%{json.escape(req.method)}V",
"request_protocol": "%{json.escape(req.proto)}V",
"request_referer": "%{json.escape(req.http.referer)}V",
"request_user_agent": "%{json.escape(req.http.User-Agent)}V",
"response_state": "%{json.escape(fastly_info.state)}V",
"response_status": %{resp.status}V,
"response_reason": %{if(resp.response, "%22"+json.escape(resp.response)+"%22", "null")}V,
"response_body_size": %{resp.body_bytes_written}V,
"fastly_server": "%{json.escape(server.identity)}V",
"fastly_is_edge": %{if(fastly.ff.visits_this_service == 0, "true", "false")}V
}
Is it possible that the example code for Sumo Logic is untested and not valid to begin with?
Please advise. Thanks.