- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
lukejadamec
Super Champion
10-11-2013
05:43 PM
I'm not a big regex power yet, I know this is easy, but since it is not on a system I can't test and figure out myself I'm looking for expert assistance.
Can someone provide a search rex that will pull both the interface and up-down fields from this log?
Oct 9 12:01:18 hos-a-3550-1.rockefeller.internal 2635634: Oct 9 12:01:17: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down
Oct 9 12:01:18 hos-a-3550-1.rockefeller.internal 2635634: Oct 9 12:01:17: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up
Looking for a rex that pulls two fields:
search | rex field=_raw ?(?<interface>?)?(?<up-down>?)? | stats count by interface,up-down
Thanks,
Luke
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yannK

Splunk Employee
10-12-2013
09:20 AM
Here
mysearch | rex "Interface (?<interface>[^, ]*), changed state to (?<state>\w+)" | table interface state
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yannK

Splunk Employee
10-12-2013
09:20 AM
Here
mysearch | rex "Interface (?<interface>[^, ]*), changed state to (?<state>\w+)" | table interface state
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yannK

Splunk Employee
10-14-2013
09:44 AM
here is a good place to start
http://www.regular-expressions.info/quickstart.html
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
lukejadamec
Super Champion
10-12-2013
10:03 AM
Thanks. I totally need to learn regex.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yannK

Splunk Employee
10-11-2013
09:56 PM
please show that you are looking for precisely.
