cli icon indicating copy to clipboard operation
cli copied to clipboard

Logging Create using Windows - Unable to pass format via command line

Open JamoCA opened this issue 1 year ago • 5 comments

Could the "logger create" functions be updated to "accept a string or file path" for the "format" argument?

I'm using Fastly CLI v10.17.1 (0ce75689) and am having a very difficult time passing the "format" parameter when creating a sumologic log.

I noticed that the "VCL Create" function has a "content" argument that accepts either 1) a string or 2) a file path. The logging "format" argument would benefit by receiving the same treatment since it's impractical (and maybe impossible) to enter when using the Fastly CLI in a Windows environment.

The format payload that I'm using is the one that Sumo Logic recommends using with Fastly. https://help.sumologic.com/docs/integrations/saas-cloud/fastly/ https://gist.github.com/JamoCA/e3d82dedad9c35a0c1bd3b444e367728

I also tried using the format posted on the Fastly documentation: https://docs.fastly.com/en/guides/log-streaming-sumologic

No matter what I try and how I escape the string so, the CLI returns an error message.

If you desire more information, I have a Fastly support ticket #863460 open and the person helping me doesn't have an environment, has limited exposure to the CLI and may not be using Windows. I've provided them with complete information, but it seems very basic... except for the hoops required to format the "format" argument.

JamoCA avatar Dec 18 '24 23:12 JamoCA

Yes, this seems like a very reasonable request, since as you say the content being provided is subject to escaping and interpolation. We have the facility already in the CLI to do this. I can't commit to it being done soon, as we're about to be mostly shut down for the holidays/year-end, but we'll look into this in January.

kpfleming avatar Dec 19 '24 16:12 kpfleming

Please let the support person know that Jira ticket CDTOOL-989 (not visible to the public) has been created for this and should be linked to the support ticket.

kpfleming avatar Dec 19 '24 16:12 kpfleming

We're new and currently migrating from Edgio. Our contract is up with them at the end of the month.

Does the v10.17.1 CLI work in a Windows environment for the "logging .. create" function? If so, what has to be done to the "format" payload in order for it to be posted successfully? (The CLI doesn't throw an error, but the Fastly API backend rejects it as "invalid".) Thanks.

JamoCA avatar Dec 19 '24 16:12 JamoCA

If I can suggest an alternative, it would be easier (and better for the community) to have this conversation on Fastly Connect. Conversations there are more easily discovered and more people can participate.

kpfleming avatar Dec 19 '24 16:12 kpfleming

Thanks. I've cross-posted to "Fastly Connect" too.

Here's the forum link in case anyone seeing this issue wants to join the conversation there. https://community.fastly.com/t/issues-with-windows-cli-logging-create-function/3749

JamoCA avatar Dec 19 '24 17:12 JamoCA