cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
3106
Views
0
Helpful
4
Replies

EEM Script for parsing & writing to output

patelvc7601
Level 1
Level 1

Hi 

I am trying to capture output of certain command & Parse & than write the output into the file . I also want to repeate this process & appened the output .

Below works fine where I am capturing the output & appending to the file but i want to parse the output(show cell 0 all | inc SNR|RSSI|RSRP) & than wanted to write the file .

I looked into the action file but there is no append 

 

event manager applet SIGNAL-STRENGTH
event timer cron name SIGNAL-STRENGTH cron-entry "*/5 * * * *"
action 10 cli command "enable"
action 20 cli command "show clock | append flash:SIGNAL-STRENGTH.txt"
action 30 cli command "show cell 0 all | append flash:SIGNAL-STRENGTH.txt"
 
Also documentation wise, if someoone can suggest material that will be great.
 
Sincerely
Viral Patel
2 Accepted Solutions

Accepted Solutions

They resemble the Tcl functionality.  So remove "file" and look at the Tcl docs for the next command (e.g., "open", "puts", etc.).

For open : https://www.tcl.tk/man/tcl8.3/TclCmd/open.htm

View solution in original post

thank you joe.

Sincerely

Viral Patel

View solution in original post

4 Replies 4

Joe Clarke
Cisco Employee
Cisco Employee

The file action is a series of actions.  The first being "file open".  This takes an argument of the access type of the file.  If you open the file with "a" then it is opened for appending:

 

file open fd flash:SIGNAL-STRENGTH.txt a

file puts fd "Hello,"

file close fd

file open fd flash:SIGNAL-STRENGTH.txt a

file puts fd "World!"

file close fd

 

At this point, the file's contents will be:

 

Hello,

World!

Thanks  Joe, that worked.

 where can I find mor information on file command.

Sincerely

Viral Patel

They resemble the Tcl functionality.  So remove "file" and look at the Tcl docs for the next command (e.g., "open", "puts", etc.).

For open : https://www.tcl.tk/man/tcl8.3/TclCmd/open.htm

thank you joe.

Sincerely

Viral Patel

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: