cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1336
Views
0
Helpful
2
Replies

Exporting selected counters to syslog

sprocket10
Level 2
Level 2

Currently I am running this part of a script to export the entire result to our syslog. However I only require 2 parts from the output (highlighted in below output). I have other scripts that do this, but as both lines start with a non consistant counter I am unsure how to pick out this data.

I would usually have something like: action 040 regexp "(Configured .*)" "$_cli_result" match line

Currently use:

action 030 cli command "show interface cellular 0"
action 040 regexp "(.*)" "$_cli_result" output

Output:

Cellular0 is up, line protocol is up
  Hardware is 4G WWAN Modem - Global Multimode LTE/DC-HSPA+/HSPA+/HSPA/UMTS/EDGE/GPRS
  Internet address will be assigned dynamically by the network
  MTU 1500 bytes, BW 50000 Kbit/sec, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation SLIP, loopback not set
  Keepalive not supported
  Interface is bound to Di0 (Encapsulation SLIP)
  Last input 00:00:00, output never, output hang never
  Last clearing of "show interface" counters 00:11:07
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/10 (size/max)
  5 minute input rate 1000 bits/sec, 1 packets/sec
  5 minute output rate 1000 bits/sec, 1 packets/sec
     472 packets input, 67861 bytes, 0 no buffer
     Received 0 broadcasts (0 IP multicasts)
     0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     508 packets output, 91666 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 unknown protocol drops
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up

1 Accepted Solution

Accepted Solutions

Mark Malone
VIP Alumni
VIP Alumni

for the cli command you could try this ,that should just pick up those two lines

sh int cellular 0 | i input,|output,

View solution in original post

2 Replies 2

Mark Malone
VIP Alumni
VIP Alumni

for the cli command you could try this ,that should just pick up those two lines

sh int cellular 0 | i input,|output,

that will do perfectly thanks