Skip to main content
RafalS
New Member
June 21, 2012
Question

' begin' output filter in FortiOS?

  • June 21, 2012
  • 5 replies
  • 7944 views
Hi, having hard time finding the FortiOS equivalent for Cisco' s: show [...] | begin [...] Please advise. Thank you.

    5 replies

    ede_pfau
    SuperUser
    SuperUser
    June 21, 2012
    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.
    RafalS
    RafalSAuthor
    New Member
    June 21, 2012
    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?
    ede_pfau
    SuperUser
    SuperUser
    June 21, 2012
    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.
    laf
    New Member
    July 4, 2012
    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.
    BSeklecki_GE
    Explorer II
    January 19, 2024

    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]"

    Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
    Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.
    Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!