Page 1 of 1

Process CLI config constrcut in Spreadsheet friendly format

Posted: Thu Jun 18, 2015 8:05 pm
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"

Re: Process CLI config constrcut in Spreadsheet friendly for

Posted: Tue Jul 07, 2015 3:45 pm
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