Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
...et voila! All my logged events pop up on my screen in realtime (or a close approximation thereof), and I'm happy.
Well, sort of. Problem is, I can't tell which device the messages are coming from, and I need to be looking at them at the same time.
What I'd like to do is add "fw01:" or "fw02:" to all the stuff that shows up on the screen. Can I do that? It seems to me that should be an easy piping operation but I can't wrap my brain around it.
OK, thanks for the info, but neither of these is what I'm looking to do here.
indienick, your solution still does not specify which input is coming from which host, which is the point of this question.
junpa, I really don't want to mess around with iptables, and I do not want the logs themselves to record fw01:<whatever> and fw02:<whatever>. I just want the output displayed on the screen with these identifiers.
It seems there *should* be a way to just preface every line coming through tail's stdout with a text identifier for easy viewing. The desired result is something like this:
Code:
fw01: <date/ time> packet(xyz) from IP <abc> to IP <ghj> port <d> session <e> allowed.
fw02: <date/ time> packet(xyz) from IP <abc> to IP <ghj> port <d> session <e> allowed.
fw01: <date/ time> packet(xyz) from IP <abc> to IP <ghj> port <d> session <e> allowed.
fw02: <date/ time> packet(xyz) from IP <abc> to IP <ghj> port <d> session <e> dropped - Rule 21.
fw01: <date/ time> packet(xyz) from IP <abc> to IP <ghj> port <d> session <e> dropped - Rule 4.
This is what I want to see on my screen. I'm already getting the data from both in realtime so I'm almost there, I just want to tell them apart.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.