Skip to content

Lost query lines for a multiline query when using "az monitor log-analytics workspace saved-search create" #21750

@lqm678

Description

@lqm678

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug
Lost query lines for a multiline query when using "az monitor log-analytics workspace saved-search create"

To Reproduce

az monitor log-analytics workspace saved-search create -g MyRG --workspace-name MyWS -n MySavedSearch --category Test1 --display-name TestSavedSearch -q $query

If the query is a multiline string. (A typical scenario is a query from az monitor log-analytics workspace saved-search list)

Expected behavior
Should keep the multiline query string.

Suggestions
Method-1: Check the input value of --query: if it's a file, then read the file content, this should be safe, easy and transparent.
Method-2: Provide a new option like --query-from-file , need 2 validations.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions