Process CLI config constrcut in Spreadsheet friendly format

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
slouw
Posts: 8
Joined: Wed Dec 18, 2013 4:48 pm

Process CLI config constrcut in Spreadsheet friendly format

Post by slouw »

I am a perle regex type so wish to do my work in that.
My problem is described below.
So comments wrt approach greatly appreciated.
I have several ideas but probably for clarity I will hold back here for now.
My main problem as I see it is to accommodate the variable number of match statements under each class-map.

Consider this sample text:
Image

I wish to process it so that I can import it into a spreadsheet so that it looks like this:
Image

The raw text I used to import into spreadsheet looks like this:
Image

Ths source text is as follows:

Code: Select all

class-map type http loadbalance match-any L7_CLASS_ONE
  2 match http header Host header-value "boo-stage.blah.com"
  3 match http header Host header-value "boo-m.blah.com"
class-map type http loadbalance match-any L7_CLASS_TWO
  100 match http header Host header-value ".*eureka.com"
  100 match http header Host header-value ".*eureka.com"
  100 match http header Host header-value ".*eureka.com"
  100 match http header Host header-value ".*eureka.com"
class-map type http loadbalance match-any L7_CLASS_THREE
  100 match http header Host header-value ".*boatcentre.com.au"
  100 match http header Host header-value ".*eureka.com"
  100 match http header Host header-value ".*eureka.com"
class-map type http loadbalance match-any L7_CLASS_FOUR
  100 match http header Host header-value ".*blah.com"
class-map type http loadbalance match-any L7_CLASS_FIVE
  110 match http header Host header-value ".*escape.com.au"
  120 match http header Host header-value ".*studentboats.com.au"
  130 match http header Host header-value ".*boatcentre.com.au"
  140 match http header Host header-value ".*blah.com.au"
  150 match http header Host header-value ".*blah.co.nz"
  160 match http header Host header-value ".*blah.co.za"
  170 match http header Host header-value ".*quickstuff.com"
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Process CLI config constrcut in Spreadsheet friendly for

Post by DataMystic Support »

You only have two lines types, so use a

class-map type http loadbalance match-any L7_CLASS_FIVE
110 match http header Host header-value ".*escape.com.au"

Filters\Restrict\Matching lines (grep)
with pattern of 'class-map'
and inside this, put one regex

and then another

Filters\Restrict\Matching lines (grep)
with pattern of 'match http'
and inside this, put a different regex
Post Reply