cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8967
Views
0
Helpful
30
Replies

show run command with date

Hello Community,

Is there a command in the IOS that will pick up todays date?

For example, show loggin | inc <todays_date>

Cheers

Carlton

30 Replies 30

Hai Dao Tuan
Level 1
Level 1

Here my tclsh script, that can shows today, yesterday,...

!********************

terminal length 0

tclsh

# Today
set today [clock format [clock seconds] -format "%b %d"]

# Yesterday
set yesterday [clock format [expr {[clock seconds] - 86400}] -format "%b %d"]


# anyday

set anyday [clock format [expr {[clock seconds] - <replace day x 86400>}] -format "%b %d"]

# Remove zero in day before 10
set today [string map {" 0" "  "} $today]
set yesterday [string map {" 0" "  "} $yesterday]

show logging | inc $today

show logging | inc $yesterday

!********************