Azure / Azure/azure-cli

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

Open
#21,750 3 comments 0 reactions 1 assignee Assigned to @AllyW View on GitHub
act-observability-squad Auto-Assign Customer Usage customer-reported feature-request Monitor Traiged
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

> ### `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"](https://docs.microsoft.com/en-us/cli/azure/monitor/log-analytics/workspace/saved-search?view=azure-cli-latest#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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.