C
C
CTOPMbI42017-05-10 14:05:55
linux
CTOPMbI4, 2017-05-10 14:05:55

What is the best way to parse messages?

The task is to display
information about user authorization from /var/log/messages. Further it is necessary to write down all this business in a database for example Mysql. Then bring it up to the software.
That is, you need an analogue of Windows logs.
Experienced advice needed. What is the best way to do this?
Make a parser for example in BASH? Or are there any ready-made solutions?

SUSE Linux Enterprise Server 11

Answer the question

In order to leave comments, you need to log in

5 answer(s)
D
dummyman, 2017-05-10
@dummyman

awk is responsible for parsing text files in linux .
There is a good book .

D
Dmitry Tallmange, 2017-05-10
@p00h

The task is not completely clear.
To display information from /var/log/messages, just do the following: Specify the task.

D
Dmitry Shitskov, 2017-05-10
@Zarom

Perhaps this approach will work for you. In /etc/syslog.conf add the line:
Then you will get the required information in the secure log file

V
Victor Taran, 2017-05-10
@shambler81

tail -f /var/log/messages | grep "че вам нужно" - and you get a live log only for this line
if you need to write it down
If you need to write all this to the database, then who is stopping you from writing to it.

mysql -uroot -pтут_парол << EOF
Тут что нужно записать 
EOF

In Linux there is no "analogue of the log" you forgive me, such wretchedness has not yet been invented in it. Linux is much easier.
Describe more precisely the task, what kind of thing you need to do.
With an example of a file from which to take.
Where to put the database structure, or how you should display this information.
+

E
Erelecano Oioraen, 2017-05-10
@Erelecano

> Next, you need to write the whole thing to a database, for example Mysql
google://syslog-ng mysql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question