作者:邓聪聪
提取日志或文本中的关键内容
Apr :: localhost NetworkManager[]: <info> (eno16777736): Activation: starting connection 'eno16777736' (ecefc7de-e893-4eee-88fd-bb9843616ec2)
Apr :: localhost NetworkManager[]: <info> (eno16777736): device state change: disconnected -> prepare (reason 'none') [ ]
Apr :: localhost NetworkManager[]: <info> NetworkManager state is now CONNECTING
Apr :: localhost NetworkManager[]: <info> (eno16777736): device state change: prepare -> config (reason 'none') [ ]
Apr :: localhost NetworkManager[]: <info> (eno16777736): device state change: config -> ip-config (reason 'none') [ ]
Apr :: localhost NetworkManager[]: <info> Activation (eno16777736) Beginning DHCPv4 transaction (timeout in seconds)
Apr :: localhost NetworkManager[]: <info> dhclient started with pid
Apr :: localhost dhclient[]: DHCPDISCOVER on eno16777736 to 255.255.255.255 port interval (xid=0x398e2136)
Apr :: localhost dhclient[]: DHCPREQUEST on eno16777736 to 255.255.255.255 port (xid=0x398e2136)
Apr :: localhost dhclient[]: DHCPOFFER from 10.0.0.254
Apr :: localhost dhclient[]: DHCPACK from 10.0.0.254 (xid=0x398e2136)
Apr :: localhost NetworkManager[]: <info> address 10.0.0.132
Apr :: localhost NetworkManager[]: <info> plen (255.255.255.0)
Apr :: localhost NetworkManager[]: <info> gateway 10.0.0.2
Apr :: localhost NetworkManager[]: <info> server identifier 10.0.0.254
Apr :: localhost NetworkManager[]: <info> lease time
Apr :: localhost NetworkManager[]: <info> nameserver '10.0.0.2'
Apr :: localhost NetworkManager[]: <info> domain name 'localdomain'
Apr :: localhost NetworkManager[]: <info> (eno16777736): DHCPv4 state changed unknown -> bound
Apr :: localhost NetworkManager[]: <info> (eno16777736): device state change: ip-config -> ip-check (reason 'none') [ ]
Apr :: localhost NetworkManager[]: <info> (eno16777736): device state change: ip-check -> secondaries (reason 'none') [ ]
Apr :: localhost NetworkManager[]: <info> (eno16777736): device state change: secondaries -> activated (reason 'none') [ ]
Apr :: localhost NetworkManager[]: <info> NetworkManager state is now CONNECTED_LOCAL
Apr :: localhost NetworkManager[]: <info> NetworkManager state is now CONNECTED_GLOBAL
Apr :: localhost NetworkManager[]: <info> Policy set 'eno16777736' (eno16777736) as default for IPv4 routing and DNS.
Apr :: localhost NetworkManager[]: <info> (eno16777736): Activation: successful, device activated.
Apr :: localhost nm-dispatcher: Dispatching action 'up' for eno16777736
Apr :: localhost network: Bringing up interface eno16777736: Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/)
Apr :: localhost dhclient[]: bound to 10.0.0.132 -- renewal in seconds.
Apr :: localhost network: [ OK ]
Apr :: localhost systemd: Started LSB: Bring up/down networking.
Apr :: localhost dbus[]: avc: received setenforce notice (enforcing=)
Apr :: localhost dbus-daemon: dbus[]: avc: received setenforce notice (enforcing=)
Apr :: localhost systemd: Stopping firewalld - dynamic firewall daemon...
Apr :: localhost kernel: Ebtables v2. unregistered
Apr :: localhost systemd: Stopped firewalld - dynamic firewall daemon.
Apr :: localhost systemd: Started Session of user root.
Apr :: localhost systemd-logind: New session of user root.
Apr :: localhost systemd: Starting Session of user root.
Apr :: localhost dhclient[]: DHCPREQUEST on eno16777736 to 10.0.0.254 port (xid=0x398e2136)
Apr :: localhost dhclient[]: DHCPACK from 10.0.0.254 (xid=0x398e2136)
Apr :: localhost NetworkManager[]: <info> address 10.0.0.132
Apr :: localhost NetworkManager[]: <info> plen (255.255.255.0)
Apr :: localhost NetworkManager[]: <info> gateway 10.0.0.2
Apr :: localhost NetworkManager[]: <info> server identifier 10.0.0.254
Apr :: localhost NetworkManager[]: <info> lease time
Apr :: localhost NetworkManager[]: <info> nameserver '10.0.0.2'
Apr :: localhost NetworkManager[]: <info> domain name 'localdomain'
Apr :: localhost NetworkManager[]: <info> (eno16777736): DHCPv4 state changed bound -> bound
Apr :: localhost dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost systemd: Starting Network Manager Script Dispatcher Service...
Apr :: localhost dbus-daemon: dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost dhclient[]: bound to 10.0.0.132 -- renewal in seconds.
Apr :: localhost dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost dbus-daemon: dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost systemd: Started Network Manager Script Dispatcher Service.
Apr :: localhost nm-dispatcher: Dispatching action 'dhcp4-change' for eno16777736
Apr :: localhost systemd: Starting Cleanup of Temporary Directories...
Apr :: localhost systemd: Started Cleanup of Temporary Directories.
Apr :: localhost dhclient[]: DHCPREQUEST on eno16777736 to 10.0.0.254 port (xid=0x398e2136)
Apr :: localhost dhclient[]: DHCPACK from 10.0.0.254 (xid=0x398e2136)
Apr :: localhost NetworkManager[]: <info> address 10.0.0.132
Apr :: localhost NetworkManager[]: <info> plen (255.255.255.0)
Apr :: localhost NetworkManager[]: <info> gateway 10.0.0.2
Apr :: localhost NetworkManager[]: <info> server identifier 10.0.0.254
Apr :: localhost NetworkManager[]: <info> lease time
Apr :: localhost NetworkManager[]: <info> nameserver '10.0.0.2'
Apr :: localhost NetworkManager[]: <info> domain name 'localdomain'
Apr :: localhost NetworkManager[]: <info> (eno16777736): DHCPv4 state changed bound -> bound
Apr :: localhost dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost dbus-daemon: dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost systemd: Starting Network Manager Script Dispatcher Service...
Apr :: localhost dhclient[]: bound to 10.0.0.132 -- renewal in seconds.
Apr :: localhost dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost dbus-daemon: dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost systemd: Started Network Manager Script Dispatcher Service.
Apr :: localhost nm-dispatcher: Dispatching action 'dhcp4-change' for eno16777736
Apr :: localhost systemd: Started Session of user root.
Apr :: localhost systemd: Starting Session of user root.
Apr :: localhost dhclient[]: DHCPREQUEST on eno16777736 to 10.0.0.254 port (xid=0x398e2136)
Apr :: localhost dhclient[]: DHCPACK from 10.0.0.254 (xid=0x398e2136)
Apr :: localhost NetworkManager[]: <info> address 10.0.0.132
Apr :: localhost NetworkManager[]: <info> plen (255.255.255.0)
Apr :: localhost NetworkManager[]: <info> gateway 10.0.0.2
Apr :: localhost NetworkManager[]: <info> server identifier 10.0.0.254
Apr :: localhost NetworkManager[]: <info> lease time
Apr :: localhost NetworkManager[]: <info> nameserver '10.0.0.2'
Apr :: localhost NetworkManager[]: <info> domain name 'localdomain'
Apr :: localhost NetworkManager[]: <info> (eno16777736): DHCPv4 state changed bound -> bound
Apr :: localhost dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost systemd: Starting Network Manager Script Dispatcher Service...
Apr :: localhost dbus-daemon: dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost dhclient[]: bound to 10.0.0.132 -- renewal in seconds.
Apr :: localhost dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost dbus-daemon: dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost systemd: Started Network Manager Script Dispatcher Service.
Apr :: localhost nm-dispatcher: Dispatching action 'dhcp4-change' for eno16777736
Apr :: localhost dhclient[]: DHCPREQUEST on eno16777736 to 10.0.0.254 port (xid=0x398e2136)
Apr :: localhost dhclient[]: DHCPACK from 10.0.0.254 (xid=0x398e2136)
Apr :: localhost NetworkManager[]: <info> address 10.0.0.132
Apr :: localhost NetworkManager[]: <info> plen (255.255.255.0)
Apr :: localhost NetworkManager[]: <info> gateway 10.0.0.2
Apr :: localhost NetworkManager[]: <info> server identifier 10.0.0.254
Apr :: localhost NetworkManager[]: <info> lease time
Apr :: localhost NetworkManager[]: <info> nameserver '10.0.0.2'
Apr :: localhost NetworkManager[]: <info> domain name 'localdomain'
Apr :: localhost NetworkManager[]: <info> (eno16777736): DHCPv4 state changed bound -> bound
Apr :: localhost dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost systemd: Starting Network Manager Script Dispatcher Service...
Apr :: localhost dbus-daemon: dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost dhclient[]: bound to 10.0.0.132 -- renewal in seconds.
Apr :: localhost dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost dbus-daemon: dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost systemd: Started Network Manager Script Dispatcher Service.
Apr :: localhost nm-dispatcher: Dispatching action 'dhcp4-change' for eno16777736
Apr :: localhost dhclient[]: DHCPREQUEST on eno16777736 to 10.0.0.254 port (xid=0x398e2136)
Apr :: localhost dhclient[]: DHCPACK from 10.0.0.254 (xid=0x398e2136)
Apr :: localhost NetworkManager[]: <info> address 10.0.0.132
Apr :: localhost NetworkManager[]: <info> plen (255.255.255.0)
Apr :: localhost NetworkManager[]: <info> gateway 10.0.0.2
Apr :: localhost NetworkManager[]: <info> server identifier 10.0.0.254
Apr :: localhost NetworkManager[]: <info> lease time
Apr :: localhost NetworkManager[]: <info> nameserver '10.0.0.2'
Apr :: localhost NetworkManager[]: <info> domain name 'localdomain'
Apr :: localhost NetworkManager[]: <info> (eno16777736): DHCPv4 state changed bound -> bound
Apr :: localhost dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost systemd: Starting Network Manager Script Dispatcher Service...
Apr :: localhost dbus-daemon: dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost dhclient[]: bound to 10.0.0.132 -- renewal in seconds.
Apr :: localhost dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost dbus-daemon: dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost systemd: Started Network Manager Script Dispatcher Service.
Apr :: localhost nm-dispatcher: Dispatching action 'dhcp4-change' for eno16777736
Apr :: localhost dhclient[]: DHCPREQUEST on eno16777736 to 10.0.0.254 port (xid=0x398e2136)
Apr :: localhost dhclient[]: DHCPACK from 10.0.0.254 (xid=0x398e2136)
Apr :: localhost NetworkManager[]: <info> address 10.0.0.132
Apr :: localhost NetworkManager[]: <info> plen (255.255.255.0)
Apr :: localhost NetworkManager[]: <info> gateway 10.0.0.2
Apr :: localhost NetworkManager[]: <info> server identifier 10.0.0.254
Apr :: localhost NetworkManager[]: <info> lease time
Apr :: localhost NetworkManager[]: <info> nameserver '10.0.0.2'
Apr :: localhost NetworkManager[]: <info> domain name 'localdomain'
Apr :: localhost NetworkManager[]: <info> (eno16777736): DHCPv4 state changed bound -> bound
Apr :: localhost dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost dbus-daemon: dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost systemd: Starting Network Manager Script Dispatcher Service...
Apr :: localhost dhclient[]: bound to 10.0.0.132 -- renewal in seconds.
Apr :: localhost dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost dbus-daemon: dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost systemd: Started Network Manager Script Dispatcher Service.
Apr :: localhost nm-dispatcher: Dispatching action 'dhcp4-change' for eno16777736
Apr :: localhost systemd: Started Session of user root.
Apr :: localhost systemd: Starting Session of user root.
Apr :: localhost dhclient[]: DHCPREQUEST on eno16777736 to 10.0.0.254 port (xid=0x398e2136)
Apr :: localhost dhclient[]: DHCPACK from 10.0.0.254 (xid=0x398e2136)
Apr :: localhost NetworkManager[]: <info> address 10.0.0.132
Apr :: localhost NetworkManager[]: <info> plen (255.255.255.0)
Apr :: localhost NetworkManager[]: <info> gateway 10.0.0.2
Apr :: localhost NetworkManager[]: <info> server identifier 10.0.0.254
Apr :: localhost NetworkManager[]: <info> lease time
Apr :: localhost NetworkManager[]: <info> nameserver '10.0.0.2'
Apr :: localhost NetworkManager[]: <info> domain name 'localdomain'
Apr :: localhost NetworkManager[]: <info> (eno16777736): DHCPv4 state changed bound -> bound
Apr :: localhost dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost systemd: Starting Network Manager Script Dispatcher Service...
Apr :: localhost dbus-daemon: dbus[]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr :: localhost dhclient[]: bound to 10.0.0.132 -- renewal in seconds.
Apr :: localhost dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost dbus-daemon: dbus[]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr :: localhost systemd: Started Network Manager Script Dispatcher Service.
Apr :: localhost nm-dispatcher: Dispatching action 'dhcp4-change' for eno16777736
grep dbus 3.log |sed -r 's/^.*host (.*): .*$/\1/g'|sed 's/dbus-daemon: //g'|awk '{print $1}'
过滤关键字 搜索
[root@admin ~]# ss -nat
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN ::: :::*
LISTEN *: *:*
LISTEN ::: :::*
LISTEN *: *:*
LISTEN 127.0.0.1: *:*
LISTEN *: *:*
LISTEN *: *:*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN *: *:*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN *: *:*
LISTEN *: *:*
LISTEN ::: :::*
ESTAB 118.188.20.3: 221.122.103.135:
TIME-WAIT 172.16.16.2: 172.16.16.9:
TIME-WAIT 172.16.16.2: 172.16.16.9:
TIME-WAIT 172.16.16.2: 172.16.16.9:
TIME-WAIT 172.16.16.2: 172.16.16.9:
TIME-WAIT 172.16.16.2: 172.16.16.9:
TIME-WAIT 172.16.16.2: 172.16.16.9:
TIME-WAIT 172.16.16.2: 172.16.16.9:
用sed取第一列:
ss -ant|sed 's/[ \t].*//'
取出第一行的指定字符串,后项引用 磁盘使用率
df |sed -nr '/^\/dev/s/([^ ]+).*$/\1/p'
df |sed -nr '/^\/dev/s/.* (.*)%.*/\1/p'