Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
RafalS
New Contributor

' begin' output filter in FortiOS?

Hi, having hard time finding the FortiOS equivalent for Cisco' s: show [...] | begin [...] Please advise. Thank you.
FCNSP 4.x running FortiOS 5.0.4 on FG621B A-A HA
FCNSP 4.x running FortiOS 5.0.4 on FG621B A-A HA
5 REPLIES 5
ede_pfau
SuperUser
SuperUser

Not sure what the ' begin' command does but I guess it' s like ' head' in UNIX. There' s not direct equivalent for this. Use ' | grep' to filter output (note the spaces around the pipe symbol) and the implicit command line ' more' feature:
 conf sys console
    set output more
 end
The number of lines displayed depends on the screen size. HTH.
Ede Kernel panic: Aiee, killing interrupt handler!
Ede Kernel panic: Aiee, killing interrupt handler!
RafalS

Thank you. Sorry for having coded my question in IOS syntax. Of course, I considered grep before posting. What I mean is a filter in CLI that will let me list a config beginning a specific expression. Per analogy to IOS, based on the full show command output: CLS#show run Building configuration... Current configuration : 30440 bytes ! ! Last configuration change at 18:05:32 CEST Tue Jun 19 2012 by whatever ! NVRAM config last updated at 20:18:38 CEST Fri Jun 1 2012 by whatever ! version 12.2 no service pad service timestamps debug datetime msec localtime service timestamps log datetime msec localtime no service password-encryption service compress-config ! [...and so on...] Same config output starting from the line where ' password' is found: CLS#show run | begin password no service password-encryption service compress-config ! [...and so on...] Is grep able to provide that?
FCNSP 4.x running FortiOS 5.0.4 on FG621B A-A HA
FCNSP 4.x running FortiOS 5.0.4 on FG621B A-A HA
ede_pfau
SuperUser
SuperUser

No, I don' t think so. grep is grep. One workaround would be to download the config and use an editor. Not elegant but better than grep alone with a long config.
Ede Kernel panic: Aiee, killing interrupt handler!
Ede Kernel panic: Aiee, killing interrupt handler!
laf
New Contributor II

There is just grep on Fortigate. It' s better than nothing and it behaves like | include on Cisco. Maybe one day we ll get more.

The most expensive and scarce resource for man is time, paradoxically, it' s infinite.

The most expensive and scarce resource for man is time, paradoxically, it' s infinite.
BSeklecki_GE
New Contributor III

So in last 14 years, has FortiOS added a mechanism to add equivalent function of "begin" ?

In POSIX/UNX, we just use "grep -A99999 [string]"

Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors