Ask Ubuntu Asked by allada01 on November 18, 2021
Here is my command:
aws logs describe-metric-filters --log-group-name mahi | jq '.metricFilters[].metricTransformations' | grep "metricName"
output:
"metricName": "APIMetric",
"metricNamespace": "APINamespace",
From the above command i need only the metricName
where it is grepping both the words which starts with metricName
.
Easiest way is to tell grep it needs to find the quotation marks too. You can avoid any escaping shenanigans by wrapping the search text in single quote marks:
aws logs describe-metric-filters --log-group-name mahi | jq '.metricFilters[].metricTransformations' | grep '"metricName"'
Answered by Dan Scally on November 18, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP