ConfD User Community

Display tailf:action output list as table


How to print tailf:action list output as table?
As an example, “intro/7-c_actions” prints ping output as below.

admin@sde-sde-confd> request config host ping count 4
header Invoked from cli: PING ( 56(84) bytes of data.
response {
    data 64 bytes from ( icmp_seq=1 ttl=53 time=5.25 ms
response {
    data 64 bytes from ( icmp_seq=2 ttl=53 time=7.47 ms
response {
    data 64 bytes from ( icmp_seq=3 ttl=53 time=4.89 ms

Is there anyway we can display response output list as a table instead of braces?


You can’t really change CLI output from an action directly, I’m afraid. But you can do one of the following:

  • declare (in your clispec file) and implement s.c. pipe command - it can be a script that reformats the output of your action; you can then use the action like request config ... | reformat

  • reimplement your action as a CLI command - you can reuse big part of the code, the advantage of a CLI command is that you can format it however you want; probably with some tricks in your clispec file you can even “override” the action so that the command is used when requested from CLI.

See man clispec for more details.