Am trying to bring output like below in AWS console for Cloudwatch metric filter pattern
[w1,w2,w3,w4=!"*10.1.1.1*"&&w5=!"*10.1.1.2*"&&w5="*admin*"]
for one of my ruby aws sdk script with below function
data_of_ips = ["10.1.1.1", "10.1.1.2"]
def run_me(data_of_ips)
:::
:::
filter_pattern = '[w1,w2,w3,w4!='"*#{data_of_ips[0]*"'&&w4!='"*#{data_of_ips[1]*"',w5="*admin*"]'
but in the aws console output I could see the output like below without " (double quotes) for w4.
[w1,w2,w3,w4=!*10.1.1.1*&&w4=!*10.1.1.2*&&w5="*admin*"]
Please help me out to fix this.
Is this what you expect?
If you want to put variable or script inside a string, I suggest you can use double quote with
#{}to do that. It's more clear. And the special char like"you can just use\"to write them.