LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-29-2018, 01:36 PM   #1
martijndutch
LQ Newbie
 
Registered: Aug 2018
Posts: 2

Rep: Reputation: Disabled
rsyslog templates


Hello,

I'm using rsyslog to consolidate and forward evens gathered from ubiquity access points. As these events are coming in from a remote site, they all appear to originate from the external IP of that site (blabla.wanadoo.fr). This information is completely irrelevant for me. Luckily, in the message itself, is the relevant part being the MAC of the device. I want to do the following:
  1. Replace the host value with the mac address
  2. Remove everything between (" ... ")

Code:
Aug 29 20:27:50 lputeaux-657-1-11-111.w217-128.abo.wanadoo.fr ("U7MP,788a20b00b71,v3.9.49.9260") kernel: [89063.790000] ieee80211_ioctl_set_ratelimit: node with aid 3 and mac bc:6c:21:94:b2:47 has been t
How should I configure the rsyslog template?


btw, log processing tools like LogRhythm and Papertrail already start interpreting the line and showing it as:

Code:
Aug 29 20:32:21 lputeaux-657-1-11-111.w217-128.abo.wanadoo.fr ("U7MP: ,788a2023a0e4,v3.9.42.9152 libubnt[2081]: wevent.ubnt_handle_custom_alert_sta_assoc():
thereby removing the ")

Thank you for your help!
 
Old 08-30-2018, 07:59 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by martijndutch View Post
Hello,
I'm using rsyslog to consolidate and forward evens gathered from ubiquity access points. As these events are coming in from a remote site, they all appear to originate from the external IP of that site (blabla.wanadoo.fr). This information is completely irrelevant for me. Luckily, in the message itself, is the relevant part being the MAC of the device. I want to do the following:
  1. Replace the host value with the mac address
  2. Remove everything between (" ... ")
Code:
Aug 29 20:27:50 lputeaux-657-1-11-111.w217-128.abo.wanadoo.fr ("U7MP,788a20b00b71,v3.9.49.9260") kernel: [89063.790000] ieee80211_ioctl_set_ratelimit: node with aid 3 and mac bc:6c:21:94:b2:47 has been t
How should I configure the rsyslog template?
btw, log processing tools like LogRhythm and Papertrail already start interpreting the line and showing it as:
Code:
Aug 29 20:32:21 lputeaux-657-1-11-111.w217-128.abo.wanadoo.fr ("U7MP: ,788a2023a0e4,v3.9.42.9152 libubnt[2081]: wevent.ubnt_handle_custom_alert_sta_assoc():
thereby removing the ") Thank you for your help!
Look at property based filters, specifically the compare operations. There isn't anything that looks at MAC addresses (that I can see, at least), but it CAN act on strings. So if you know the MAC's in question, you could search/replace/filter things based on that, treating it as a string.

https://www.rsyslog.com/doc/v8-stabl...n/filters.html
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Every two minutes rsyslog outputs - rsyslogd: action 'action 3' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 Toadman Linux - Software 9 09-01-2018 12:41 PM
What are templates? andul Linux - Newbie 3 11-29-2015 03:20 AM
C++ templates vbx_wx Programming 1 09-26-2010 01:06 PM
Templates MGLindsey Linux - Networking 0 07-02-2002 11:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration