Process CLI config constrcut in Spreadsheet friendly format

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

Process CLI config constrcut in Spreadsheet friendly format

Postby slouw » Thu Jun 18, 2015 8:05 pm

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: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Process CLI config constrcut in Spreadsheet friendly for

Postby DataMystic Support » Tue Jul 07, 2015 3:45 pm

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
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Baidu [Spider] and 5 guests