Reply

Is it possible to use a script variable in a script filter?

Adviser
Posts: 66
1733     0

I am trying to run a script on a subset of devices in a group- in this case based on the name.  If i hard set the name in the filter it works fine, but i would like to make it more extensible and allow the user to enter the filter parameter without editing the file.

Is the following possible? (this code doesn't work, so i'm missing something if it is possible)

Script-Variables:
    $Commands_to_be_Executed    text        "Enter commands here, one per line"
    $devicename string "device name"

Script-Filter:
    $Vendor eq "Cisco"   and
    $sysDescr like /IOS/ and 
    $Name like /^$devicename\.\d{4}/

Action-Filter

Adviser
Posts: 463
1734     0

Why don't you try setting it at the action level Smiley Happy

Action-Filter:

    $Name like /^$devicename\.\d{4}/

 

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh

https://sifbaksh.com
Showing results for 
Search instead for 
Did you mean: 

Recommended for You