Skip to main content
JG1
New Member
June 16, 2017
Question

FMGR JSON API: How to get a specific webfilter rule?

  • June 16, 2017
  • 0 replies
  • 2826 views

Hi All

 

I am trying to get a specific webfilter rule returned rather than the whole lot and then parse it, but the filter options I have set do indeed get the right profile, only returning all entries. Here's what I am using right now, but it returns all entries rather than the first one:

 

use FMG::JSONAPI

%options = (

    fields => ["name", "comment", "id", "obj seq"],
    filter => ["obj seq","==","1"]

);

 

The output is as following:

 

$VAR1 = [ { 'name' => 'my-web-filter', 'id' => 1, 'comment' => '', 'entries' => [ { 'type' => 'simple', 'action' => 'block', 'url' => 'example.com', 'obj seq' => 1, 'status' => 'enable' }, { 'obj seq' => 2, 'action' => 'block', 'url' => 'example2.com', 'status' => 'enable', 'type' => 'simple' }, ...

 

There is scant documentation that I can refer to. Essentially, this is a question about the syntax of the filter.

 

I am on v5.2.2-build0706 150415 (GA).

 

You help will be much appreciated.

 

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.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!