# How to append custom completion to ConfD command redirection

**URL:** <https://dmap-community.ductus.global/t/how-to-append-custom-completion-to-confd-command-redirection/3421>\
**Category:** Other Northbound Interfaces\
**Created:** [December 14, 2020, 7:17am UTC](https://dmap-community.ductus.global/t/how-to-append-custom-completion-to-confd-command-redirection/3421 "2020-12-14T07:17:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mishuta](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@mishuta](https://dmap-community.ductus.global/u/mishuta)\
**Post date:** [December 14, 2020, 7:17am UTC](https://dmap-community.ductus.global/t/how-to-append-custom-completion-to-confd-command-redirection/3421/1 "2020-12-14T07:17:56Z")

</div>

Hi,

Is there a way to add options to Confd command output processing?  
In particular I want to add “head” possible completions to my command output processing that will give me the #n first lines (in case n is positive, n last lines in case it is negative and all lines in case n equal zero).

So it will look like this:

```
admin@CableOS> show running-config |       
Possible completions:
  append Append output text to a file
  begin Begin with the line that matches
  best-effort Display data even if data provider is unavailable or continue loading from file in presence of failures
  context-match Context match
  count Count the number of lines in the output
  csv Show table output in CSV format
  de-select De-select columns
  details Display default values
  display Display options
  exclude Exclude lines that match
  extended Display referring entries
  include Include lines that match
  linnum Enumerate lines in the output
  match-all All selected filters must match
  match-any At least one filter must match
  more Paginate output
  nomore Suppress pagination
  repeat Repeat show command with a given interval
  save Save output text to a file
  select Select additional columns
  sort-by Select sorting indices
  tab Enforce table output
  until End with the line that matches
  head displays only the first n lines

```

I read many posts here including Confd spec and I didn’t find any solution to it.  
except that those possible completions are located in :

> “confd/cdb/ccap\_init.xml”

file in the following way:  
`<command><pattern>configure linnum</pattern></command>`

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [December 16, 2020, 3:41pm UTC](https://dmap-community.ductus.global/t/how-to-append-custom-completion-to-confd-command-redirection/3421/2 "2020-12-16T15:41:05Z")

</div>

You want to use the clispec, addPipeFlags, and pipeCmds.  
I believe this post from 4 years ago is close enough for what you want to do:

> [@Collect input from user](http://dmap-community.ductus.global/t/collect-input-from-user/397/13):
>
> Hi lynn, A filter, e.g. a CLI show | select statement, a NETCONF, JSON-RPC, MAAPI query etc. is something that is transformed to a filter that the ConfD core engine understands. You want to get this “filter” that ConfD use and pre-filter in your data provider application, but there is no API to pass the “filter” to your data provider in ConfD. So if you absolutely cannot live with the ConfD core engine doing the filtering for you, but must pass a filter to your data provider application to do…
