Skip to main content

Before I started using Forward Networks, I was deep in the weeds of daily network operations. Like many of you, I relied on the CLI to do everything—whether it was compliance checks, interface audits, or config validation. It worked, but it was slow, manual, and honestly, a bit exhausting.

 

Then I discovered Network Query Engine (NQE), and everything changed.

 

My Background: Life in the CLI

 

Before discovering NQE, I managed networks using CLI commands across dozens or hundreds of devices every day.

  • Logging into individual devices—one at a time
     
  • Running the same commands repeatedly (show run | include, show run | section, etc.)
     
  • Copying results into spreadsheets to figure out what was going on
     
  • Trying to get ahead of issues, but always feeling like I was behind
     

This approach worked for a while, but it became clear that it couldn’t scale with the needs of a modern network.

 

The Breakthrough: Pattern and Block Matching

When I began exploring NQE, I realized I didn’t need to learn everything about the data model to be effective—just a few key techniques that mirrored the CLI patterns I already knew.

  • Pattern matching in NQE acts a lot like grep. You can find exactly what you’re looking for, at scale
     
  • Block matching lets you define a context or "section" of a config to extract structured data
     
  • I created a simple formula that could be reused across different commands and operating systems
     

That one repeatable pattern gave me a huge boost in efficiency and saved time right away.

 

What I Used to Do (CLI)

In the past, checking for access VLAN for interfaces in use required logging into each device and running something like:

show run | include interface | switchport access vlan

…and repeating that on every single device, then manually reviewing the results.

 

What I Do Now (NQE)

 

With NQE, I write one query and apply it across all relevant devices at once, instantly getting structured results.

  • Match only the OS I’m targeting
     
  • Apply my pattern/block matching formula
     
  • Automatically extract exactly what I’m looking for
     

Here’s the NQE I use to show run | include interface | switchport access vlan on all my network devices in one query:

 

pattern = ```
interface {name:string}
switchport access vlan {vlan:number}
```;

foreach device in network.devices
foreach interface in blockMatches(device.files.config, pattern)
select {
interface: interface.data.name,
"Access Vlan": interface.data.vlan
}

 

It’s the same logic as my CLI commands, but now it’s automated and works across the full network.

 

Where to Start if You’re New to NQE

 

If you’re just getting started with NQE, it helps to start small with something you already understand and build from there.

  • Pick a task you already know well. Something like:
     
    • Looking for open ports that haven’t seen traffic in weeks
       
    • Pulling all BGP network statements from device configs
       
    • Checking interface operational status
       
  • Use pattern/block matching. You don’t need to know the whole data model
     
  • Start with my custom command formula. It’s simple, repeatable, and works across OS types
     

You can find this approach in my Custom Commands article.

 

Taking It Further: NQE via API

 

Once you’re comfortable with NQE in the UI, you might want to run those queries elsewhere—like in a terminal or dashboard. That’s where the Forward Networks API comes in.

  • I can schedule queries or integrate them into my own apps
     
  • I don’t have to log into the Forward Networks platform every time
     
  • I can pull NQE results directly into Power BI, Splunk, or my scripts
     

You can read my Intro to the Forward Networks API for a beginner-friendly walkthrough.

 

You Don’t Have to Go It Alone

 

You don’t have to become an expert in NQE to get value from it—there’s plenty of help available if you know where to look.

Even if you just want to know, “Can NQE do this?”—ask. The goal isn’t to turn everyone into a query-writing wizard. It’s to make you aware of what’s possible and know the basics to get what you need.  .

 

Where to Go From Here

 

If you’re ready to start experimenting with NQE, here are a few easy next steps to help guide your journey.

  • Try a simple NQE query using my pattern matching formula
     
  • Read other community examples

    and many, many more.

  • Start thinking about how you could use this in your own workflows
     
  • Keep your eye out—we’re always adding new community KB articles on custom commands and many other topics. Let us know if there’s a topics you’d like to see!

 

Wrapping it Up

 

If you’re like me and you came from the CLI world, I want you to know:

  • You already have the skills you need to succeed with NQE
     
  • You don’t have to learn everything about the data model to get value fast
     
  • With just a few small changes in how you approach common tasks, you can scale your efforts across your entire network
     

This journey—from CLI to NQE—has been game-changing for me. And I hope it is for you, too.

Let me know in the comments if you try it out or need help getting started—I’m happy to help!

 

Be the first to reply!

Reply