Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Tlog in linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to use Tlog in linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Tlog is a software package for recording and playback of terminal iCandle O in Linux. It is used to implement a centralized user session recording. It records all passed messages as JSON messages. The main purpose of recording to JSON format is to transfer data to storage services such as ElasticSearch, where you can search and query, as well as playback. At the same time, they retain all passed data and timing.

Tlog contains three tools, namely tlog-rec, tlog-rec-session and tlog- Play`.

Tlog-rec tools are generally used to record the input or output of a terminal, program, or shell.

The tlog-rec-session tool is used to record the entire terminal session, including the recorded user.

The tlog-play tool is used for playback recording.

In this article, I will explain how to install Tlog on a CentOS 7.4 server.

Installation

Before installing, we need to make sure that our system meets all the software requirements for the compiler and installer. In the * * step, use the following command to update the system repository and software packages.

# yum update

We need to install the dependencies required for this software installation. Before installing, I have used these commands to install all dependent packages.

# yum install wget gcc# yum install systemd-devel json-c-devel libcurl-devel m4

After completing these installations, we can download the source package of the tool and extract it to the server as needed:

# wget https://github.com/Scribery/tlog/releases/download/v3/tlog-3.tar.gz# tar-xvf tlog-3.tar.gz# cd tlog-3

Now you can start building this tool using our usual configuration and compilation methods.

#. / configure-prefix=/usr-sysconfdir=/etc & & make# make install# ldconfig

*, you need to run ldconfig. It creates the necessary links and caches for the most recent shared libraries in the directory specified on the command line, the / etc/ld.so.conf file, and the trusted directory (/ lib and / usr/lib).

Tlog work flow chart

Tlog working process

First, the user authenticates and logs in through PAM. The tlog information provided by the name service exchange (NSS) is the user's shell. This initializes the tlog section, collects information about the actual shell from the environment variable / configuration file, and starts the actual shell in PTY. Then start recording everything passed between the terminal and the PTY via syslog or sd-journal.

Usage

You can record a session using tlog-rec and play it back using tlog-play to test whether the newly installed tlog can record and play back the session properly.

Record to a file

To record the session to a file, execute tlog-rec on the command line, as follows:

Tlog-rec-writer=file-file-path=tlog.log

This command records our terminal session to a file named tlog.log and saves it in the path specified in the command.

Play back from a file

You can use the tlog-play command to play back the recorded session during or after recording.

Tlog-play-reader=file-file-path=tlog.log

This command reads the previously recorded file tlog.log from the specified path.

Thank you for reading! This is the end of this article on "how to use Tlog in linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report