Forum Discussion

Evergrim's avatar
Evergrim
Icon for Altocumulus rankAltocumulus
Jan 27, 2023

using grep to list all nodes with a specific intervall

Hi guys,

I am trying to figure out how to display all nodes that have an interval not equal to "300".

Example:
list ltm node | grep -v "interval 300" -B 5

but this way it shows me all other lines that don't have "interval 300". Consequently ALL nodes but not the one line...
I hope you can follow me. 😄

does anyone have an idea how I can do this better?

Best regards
Basti

4 Replies

  • Evergrim This will show you all node names followed by lines that have the value not equal to 300 so you can then remove all the nodes that are not followed by a line with an interval value manually.

     

    list ltm node | grep -E "node|interval " | grep -v "interval 300"

     

     

     

    • CA_Valli's avatar
      CA_Valli
      Icon for MVP rankMVP

      There's a problem with this .. default "interval" is 3600 and won't be displayed by this command so you will have nodes followed by nothing that might actually have 3600 interval 🙂 

      • Evergrim's avatar
        Evergrim
        Icon for Altocumulus rankAltocumulus

        that is correct.
        I took this command, it worked best for my purpose:

        list ltm node all-properties fqdn-templates | grep -E "node|interval" | grep -v "interval 300"


        Thanks everyone for the help!

  • should be pretty easy, try this

    tmsh list ltm node all all-properties one-line | grep -v "interval 300" | grep "ltm node" --color

     

    [edit] you could also possibly copy ^this output^ into notepad++ and bulk edit all lines to " tmsh modify ltm node X  fqdn { interval 300 } "