If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Need help with parsing a DB field into an Array

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-26-03, 00:16
rodrigj rodrigj is offline
Registered User
 
Join Date: Jun 2003
Posts: 1
Need help with parsing a DB field into an Array

I have been successful in getting all of my network device syslog messages to post to a MS Access DB. This makes it nice and neat to run sql queries on things such as date, IP host,etc. from a web front end. Unfortuately, the field in the table that holds the "offending" source IP address is in the body of a text message field. I would like to parse out just the IP address strings in this field in the database and count how many times each unique IP address appears. This would give me a nice quick way to determine that any one particular IP address is trying to hack my network for an excessive amount of attempts. Since I can't seem to get this to work through sql, because the query always returns the entire field. Does anyone know a way to get this done using VB?
Reply With Quote
  #2 (permalink)  
Old 06-30-03, 22:20
MrWizard MrWizard is offline
Registered User
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 191
Re: Need help with parsing a DB field into an Array

Quote:
Originally posted by rodrigj
I have been successful in getting all of my network device syslog messages to post to a MS Access DB. This makes it nice and neat to run sql queries on things such as date, IP host,etc. from a web front end. Unfortuately, the field in the table that holds the "offending" source IP address is in the body of a text message field. I would like to parse out just the IP address strings in this field in the database and count how many times each unique IP address appears. This would give me a nice quick way to determine that any one particular IP address is trying to hack my network for an excessive amount of attempts. Since I can't seem to get this to work through sql, because the query always returns the entire field. Does anyone know a way to get this done using VB?
My suggestion would be to use a regular expression to search through and find any text matching a pattern for an IP address. With a regular expression you could easily find the IP, and count occurrances. Regular expressions are easy to learn, but difficult to master. You can use them in an ASP page via VBscript code. Take a look on the Microsoft site knowledgebase to get more info on regular expressions. Or, have a look at the VBScript documentation.
__________________
Tim
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On