Wired Intelligent Edge

 View Only
last person joined: yesterday 

Bring performance and reliability to your network with the HPE Aruba Networking Core, Aggregation, and Access layer switches. Discuss the latest features and functionality of your switching devices, and find ways to improve security across your network to bring together a mobile-first solution
Expand all | Collapse all

CLI include with multiple patterns

This thread has been viewed 37 times
  • 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

    MVP GURU
    Posted Jan 09, 2021 06:50 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

    MVP GURU
    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

    MVP GURU
    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 11 days ago

    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!!