SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Jan 2008
    Posts
    284
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to read and parse this file values into a var?

    I have a file in below format with diff server names and server alias'es,I saved it as .txt.I need to cycle through all the virtualHost tags and get server name and do the http request there and verify it is redirected correctly and also it matches the response code.


    I need to parse out "ServerName","ServerAlias",Response code 404

    Thanks


    <VirtualHost *:80>
    ServerName www.abcd.com
    ServerAlias www.abcd.com
    DocumentRoot /usr/local/apache2/htdocs
    RedirectMatch 404 ^/(catlocal.*)
    RedirectMatch 404 ^/(project.*)
    RedirectMatch 404 ^/(local.*)
    RedirectMatch 404 ^/(catlist.*)
    DirectoryIndex index.jsp index.html
    RewriteEngine on
    RewriteOptions inherit
    </VirtualHost>

  2. #2
    Senior Member
    Join Date
    Apr 2009
    Posts
    331
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to read and parse this file values into a var?

    Easiest solution would be to convert your file into a CSV, putting the server name, alias and response code into separate columns.

    Else, you might need to host your txt file to a server and parse it with the xpath extractor

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 7.69%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:10 AM.

Copyright BetaSoft Inc.