Wired Intelligent Edge

 View Only
  • 1.  CLI include with multiple patterns

    Posted Jan 08, 2021 04:56 PM
    Hello,

    I'm currently using AOS-CX 10.5 on an Aruba 6300 and 6405.

    I've been having problems trying "grep" for multiple patterns on a single command line.

    For example, if I do a "show lldp neighbor | include '<pattern1>', 'pattern2'",  it reports "Command not supported".

    What is the correct syntax for the command line so you can include multiple patterns?

    Thank you,
    rickr

    ------------------------------
    rickr
    ------------------------------


  • 2.  RE: CLI include with multiple patterns

    Posted Jan 09, 2021 06:50 AM
    Edited by parnassus Jan 09, 2021 06:51 AM
    Hi Rick, IIRC the chaining could be done this way (example):

    show lldp neighbor | include <PATTERN-STRING-1> | include <PATTERN-STRING-2>
    Reference (example): ArubaOS-CX 10.5 Command Line Interface Guide for Aruba 8320 8325 Switch Series (Edition 1 July 2020).

    ------------------------------
    Davide Poletto
    ------------------------------



  • 3.  RE: CLI include with multiple patterns

    Posted Jan 12, 2021 02:08 PM
    Hello David,

    Apparently, this command does not work.

    According to tech-support, searching for multiple patterns is not supported from the same output.

    This command "show lldp neighbor | include <PATTERN-STRING-1> | include <PATTERN-STRING-2>"
    looks into two STDOUT.

    STDOUT1 from the "show lldp" command, and STDOUT2, from the out of "include <PATTERN-STRING-1>"

    I need it to REGEX two patterns from the same STDOUT1

    I've requested this as  a feature request.  But who knows if this will go in.

    Thank you for your response.
    rickr



    Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s).  It may contain confidential and privileged information, such as health information or trade secrets, that may be restricted from further use or disclosure by state and federal law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please immediately contact the sender by reply e-mail and destroy all copies of the original message.  Thank you.





  • 4.  RE: CLI include with multiple patterns

    Posted Jan 12, 2021 02:40 PM
    Use API (and PowerArubaCX) ;-))


    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------



  • 5.  RE: CLI include with multiple patterns

    Posted Jan 12, 2021 06:02 PM
    4 comments.

    0) Thank you for your response.

    1) Powershell is prohibited in our environment due to security concerns

    2) Using an API is not conducive to CLI real-time debugging. Unless a person writes a toolset, that is a bigger task than what I am looking for. And it would need to be flexible and dynamic for the scenarios perceived/defined.

    3) Do you have a PYTHON equivalent of your Powershell API?  If so, what are the links to get you started.

    Kind Regards,
    rickr

    Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s).  It may contain confidential and privileged information, such as health information or trade secrets, that may be restricted from further use or disclosure by state and federal law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please immediately contact the sender by reply e-mail and destroy all copies of the original message.  Thank you.





  • 6.  RE: CLI include with multiple patterns

    Posted Jan 17, 2021 08:35 AM
    Yes, there is also pyaoscx

    you can look https://developer.arubanetworks.com/aruba-aoscx for more info

    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------



  • 7.  RE: CLI include with multiple patterns

    Posted Apr 12, 2024 02:32 AM

    I know this is an old post but...
    have you just tried |excluding all the stuff you dont want?...

    example...
    show vsf detail | exc Type | exc Model | exc Status | exc "ROM Version" | exc Uptime | exc "CPU Utilization" | exc "Memory Utilization" | exc "VSF Link 1" | exc "VSF Link 2"

    Output would be Just the Mac address and serial number from above command

    Hope this helps someone else!!




  • 8.  RE: CLI include with multiple patterns

    Posted Sep 24, 2024 11:13 AM

    Hey,

    thank you for that answer. Thats a workaround for sure.

    But in all honesty: This cant be the "real" solution?
    Why did we take a step back in the cli?
    Comware Switches are easily able to filter output via regexes. And its a damn awesome and useful tool.