Got it

How to apply a regex on "include" parameter?

Created: Jun 29, 2021 23:41:02Latest reply: Jul 1, 2021 01:03:49 146 3 1 0 0
  Rewarded HiCoins: 5 (problem resolved)

Hi,


I'm trying to filter some results in VRP but I'm not getting to make it work.


Today I tried to filter OSPF cost and description of interfaces but none of the following combination worked:


dis current-configuration interface | include ^(ospf cost)|(description)$
dis current-configuration interface | include ^(ospf)+(description)$
dis current-configuration interface | include ^ospf|description$
dis current-configuration interface | include ospf descr


#


Is it possible to apply a regex to return two conditions/strings?

in this example: vlanif ospf cost + vlanif description


thanks!

Featured Answers

Recommended answer

chenhui
Admin Created Jul 1, 2021 01:03:49

Posted by ptomasi at 2021-06-30 12:10 Hi,It seems both conditions must be together without spaces between the pipe:After a lot of tries, t ...
Yes, you are right.
That is an error in the documentation. No space between the pipe is correct, and the documentation gives the wrong example.
We'll feedback that to the workmates.
View more
  • x
  • convention:

All Answers
Diego.Silva
Diego.Silva MVE Author Created Jun 30, 2021 01:10:31

Hi Friend,

I make the filter as follows:

display current-configuration | include ospf cost | 2400 (id of the VLAN)

display current-configuration | include ospf cost | SITE-1 (Description)

I don't know why, but it doesn't seem to accept the two-command filter.
View more
  • x
  • convention:

Hi,


It seems both conditions must be together without spaces between the pipe:


After a lot of tries, this command worked:


display current-configuration interface | include ospf cost|description
 description v1004
 ospf cost 5
 description v1009
 ospf cost 5
 description v1012
 ospf cost 10
 description v1021
 ospf cost 40


i_f48.gif

View more
  • x
  • convention:

Posted by ptomasi at 2021-06-30 12:10 Hi,It seems both conditions must be together without spaces between the pipe:After a lot of tries, t ...
Yes, you are right.
That is an error in the documentation. No space between the pipe is correct, and the documentation gives the wrong example.
We'll feedback that to the workmates.
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.