Extract strings of variable length

elcentro3m

Board Regular
Joined
Jan 26, 2007
Messages
60
Here's the information from two rows providing examples of the strings I'm working with:

"Tue, 2010-02-23 01:22:18 - TCP packet - Source: 192.168.1.163 - Destination: 74.125.164.97 - [Attempt to access URl: safebrowsing-cache.google.com
Src 2481 Dst 80 from LAN]

Tue, 2010-02-23 01:22:31 - TCP packet - Source: 38.107.160.138 - Destination"
"Tue, 2010-02-23 00:23:26 - UDP packet - Source: 128.208.34.91 - Destination: 64.65.186.174 - [Access Policy not found, dropping packet Src 137 Dst 137 from WAN]

From these examples I'm looking to pull:

Date-Time (Example):

Tue, 2010-02-23 01:22:18

Source IP (Example):

192.168.1.163

Destination IP (Example):

64.65.186.174

and

Url accessed (Example):

safebrowsing-cache.google.com

The Source IP is most likely to be either 9 or 10 digits depending on whether the last
set of digits is three or two, but the second Source IP (38.107.160.138) throws a wrench into any consistency of length as well as consisting of dual Sources - TCP / UDP.

Now Destination IP could be up to 12 digits (so I can't just search and extract based on
the example).

The URL accessed could be extension: net, com, org, biz, edu, etc or it could be:

[Access Policy not found, dropping packet...

If it is the latter, I don't need to see it, some kind of conditional would work excluding
said info.

If this had a simple answer, that I could figure out, I wouldn't be asking. I know I can
use FIND, MID, LEFT and RIGHT to extract information, but, the URL accessed would be
a variable length string as could either Source or Destination IPs, and the URL accessed
could also be irrelevant information as shown above in which case, conditionally, it could
be excluded.

It doesn't look to have a simple straightforward solution, but, then, I don't know nearly as
much as many of you here. Any ideas, possible solutions?

Thanx
 
Last edited:

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Maybe something like this:

Excel Workbook
ABCD
1SomethingSourceDestinationURl:
2Tue, 2010-02-23 01:22:18 - TCP packet - Source: 192.168.1.163 - Destination: 74.125.164.97 - [Attempt to access URl: safebrowsing-cache.google.com Src 2481 Dst 80 from LAN]192.168.1.16374.125.164.97safebrowsing-cache.google.com
3Tue, 2010-02-23 01:22:31 - TCP packet - Source: 38.107.160.138 - Destination38.107.160.138  
4Tue, 2010-02-23 00:23:26 - UDP packet - Source: 128.208.34.91 - Destination: 64.65.186.174 - [Access Policy not found, dropping packet Src 137 Dst 137 from WAN]128.208.34.9164.65.186.174 
Ark2
 
Upvote 0
Update:

Applied B2, C2, D2 formulas to this line:

"Mon, 2010-02-22 09:07:06 - TCP packet - Source: 192.168.1.192 - Destination: 64.124.109.237 - [Attempt to access URl: datafeed.weatherbug.com
Src 1129 Dst 80 from LAN] Mon, 2010-02-22 09:07:06 - TCP packet - Source: 192.168.1.109 - Destination: 69.6"

B2, C2 work just fine. D2 comes up empty.

Turns out I'm getting some non-standard characters in the export from Outlook
gumming up the works. Can't Search and replace, cuz they don't copy / paste
(imagine that). So, I'm working on exporting the information in a more usable format.

Stay tuned...
 
Upvote 0

Forum statistics

Threads
1,222,827
Messages
6,168,480
Members
452,192
Latest member
FengXue

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top