login
Forgot?
Login with Facebook

Don't have an account? Register one now!

Perl Regex master needed

Bids 
1
Avg Bid
$30 USD
CLOSED
  • Project ID:

    773024
  • Project Type:

    Fixed
  • Budget:

    $30-$250 USD

Project Description:

I need some help on parsing incoming data (text) for extracting "Cisco Mnemonics" in my Perl program.

Messages generated by Cisco IOS devices begin with a percent sign (%) and use the following format:
%FACILITY-SEVERITY-MNEMONIC: Message-text
The mnemonic is a device-specific code that uniquely identifies the message such as "up", "down", "changed", "config", etc.

The "facility" in Cisco mnemonics refer to a Cisco-assigned facility, they have nothing to do with the IETF definition of a "facility" integer (0-23).
Examples of Cisco-mnemonic facilities are:
%SYS-0-SYS_LCPERR0 (SYS is the Cisco facility here)
%SYS-5-CONFIG_I: (SYS is the Cisco facility here)
%STANDBY-6-STATECHANGE: (STANDBY is the Cisco facility here)
%DOT11-7-AUTH_FAILED: (DOT11 is the Cisco facility here)


Example of incoming messages that need to be parsed:
rnpwyp2u.foo.com 164 %ASA-4-106023 Deny tcp src outside:134.88.94.39/1444 dst inside:134.65.7.43/6883 by access-group "outside_acl" [0x0, 0x0]

2de4g9js.foo.com 186 248382 : : 199050: Jul 28 10:34:13.89 UTC : %CCM_RTMT-RTMT-2-RTMT-ERROR-ALERT: RTMT Alert Name:CriticalServiceDown Detail:You better look at the cluster NOW!!! Service status is DOWN. A Cisco DB. The alert is generated on Wed Jul 28 06:34:13 EDT 2010 on node 184.18.82.196. App ID:Cisco AMC Service Cluster ID: Node ID:cm6-north-pub

3n7ma7t9.foo.com 166 Juniper 2010-07-12 15:40:41 - sdhq-ssl-02-01 - [173.209.206.1] sege\dmcclure(Extranet)[Extranet - External Sharepoint Portal] - WebRequest ok : Host: extal.bal.com, Request: GET /sites/GlobalSOX/Shared%20Documents/Forms/AllItems.aspx?RootFolder=%2Fsites%2FGlOX%2FShared%20Documents%2FX%202010&View=%7b762543DE%2dB2BF%2d43A1%2d94E2%2dD84A240D0CC4%7d HTTP/1.1

eijbefbp.foo.com 86 CRON pam_unix(cron:session): session opened for user root by (uid=0)

Note that some messages have the mnemonics, some don't. Some messages may match multiple mnemonics in the same line - I just want the first.
I've created a script to parse a sampling of logs and apply a regex pattern to them. It works...MOSTLY. I need someone to make it work PERFECTLY.

My current REGEX:
my $re_mne = qr/%(\w+.+?-[0-7]-\w+.?)[:|\s]/;

But it fails to capture properly on some messages.

I will expect you to sign a non disclosure agreement because some of my log data is from other customers.

Skills required:

Cisco, Linux, Perl, System Admin

Project posted by:

cbdukes United States
(4 Reviews)

Last seen:

If you are the project creator or one of the bidders, please Log In for more options.


Awarded Bids

perlomonster Ukraine
avatar.jpg
perlomonster
Ukraine From Ukraine     Offline
  Freelancer Orientation (85%, 99th percentile)
  General Freelancer Orientation (95%, 100th percentile)
  Foundation EUFreelance.com Member
 Accepted
$30 in 0 days 
0
over 1 year ago
4.9

6.3

34 Reviews
89% Completion Rate

All Bids ()