Using rsyslog with CLI ​

Refer to understanding linux logging for understaning more about syslogs and linux logging

Here we discuss about using rsyslog wih cli, and how it can be used to log messages through CLI and also send priority messages

Log Messages

We can run the command logger to log messages from command line

[root@midas rsyslog.d]# logger "hello this is the message"
[root@midas rsyslog.d]# cat /var/log/messages | grep hello
Sep 29 19:36:38 midas /usr/libexec/gdm-wayland-session[2503]: hello,, this is secured , please dont use if you dont have unauthorized access
Oct  1 21:50:36 midas root[4555]: hello this is the message
[root@midas rsyslog.d]#

Sending rsyslog messages with priority

Priority is a critical part of logging, we need to set the priority of the message basis its severity.

Emergency Priority

Messages with emergency priority are configured such as they get rerouted to console, terminals, and ssh sessions. rsyslog allows such messages to be sent through cli which allows them to be immediately viewed by the other uses.

Run the following command from any terminal

[root@midas rsyslog.d]# logger -p emerg "this is the emergency message"

You will get following message on all the terminals

[centos@midas ~]$
Broadcast message from systemd-journald@midas (Sat 2022-10-01 21:55:43 IST):

root[4607]: this is the emergency message

Message from syslogd@midas at Oct  1 21:55:43 ...
 root[4607]:this is the emergency message

Understanding Linux Logging

Linux operating system is a popular choice for servers, logging of operating system, application, and base system events becomes crucial when hosting large commercial applications, Linux provides, multiple logging options, to help administrators and application support teams to record and track important events and assess the performance of he system and overall setup. here we will try to understand key logging features as made available by Linux OS

Learning on the job / Learnability

How you learn while working makes a lot of difference in your journey towards building a great career in tech. Even if we assume you got the right education in your school or college but it will never be possible that you acquire all the skills during your education.

As you grow in your career you have to continuously become proficient in what you already know and also learn new skills. Further, tech jobs come in all different shapes and sizes, even the same role with the same KRA in two organizations will require a different skill set to succeed.

It becomes imperative once you start working to understand the needs of the role and start learning, not every skill and expertise will come in the form of an official training assignment, you have to learn the art of acquiring skills and knowledge from daily events and experiences.

Learning itself has multiple theories around it, once you are on job it will be a combination of listening, seeing, reviewing, practicing, and it starts with curiosity and a can-do attitude is a must. Your ability to form questions from daily problems and then seek answers, will be important, for example, you were unable to solve a problem but a colleague or senior was able to do it, so the first thing is curiosity and the attitude that what was the case that you were not able to close but there were? The second would be to actually know the solution and how they figured it out. The third would be to understand the solution using any reference material physical or online, and the last would be to actually apply it.

Another way learning happens is when you stay with the problem until it is solved, this may require additional efforts, especially when you are designing or developing something, work-life balance is important but these are crucial situations that can make all the difference in whether we were able to learn something in totality or not when we stay with the problem till the end and arrive at the solution, it really helps us to connect the dots, and fill in the gaps in our concepts, and yes it makes a huge difference to our confidence and helps to build the right attitude.

When you implement something (a solution, a process) and complete the feedback loop, you can also learn a lot, as compared to when you are only a part of the implementation. When you are able to see the impact, take the feedback, and then correct things as per feedback, you are able to see the cause and effect and this helps in building a deep understanding of the problem and solution which leads to real learning.

Your curiosity in learning something new will allow you to seek new skills which may not be a part of your KRA but complementary to it, learning these skills to some level helps to do your job better, and even open opportunities for you to progress further. For example, for a tech support engineer, learning programming concepts will help you understand what is happening around you better, you will be able to communicate with right artifacts and terminologies, helping you reach solutions faster, it does not only help in improving your concepts but also provide you visibility across the teams.

In a nutshell, learning on the job or your learnability skill will be a key differentiator on how you perform and grow in your career, like other skills it is also a skill that has to be developed as you go along in your career. This doesn’t only impact your initial career but this allows you to have a deeper understanding of the work you do, helping you build and long and lasting career in Tech Industry..

..

..

Author

Nikhil Ahluwalia
Founder Upspir
Nikhil has over 16years of experience in the industry, before starting UPSPIR he was heading the support, services, and delivery function at Exotel. and he has vast experience in managing and leading technical support and delivery teams, With Upspir he aims to take his passion of developing and mentoring people to next level by sharing his experiences and learning with those who want to build their career in the tech support domain.