Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

How to list and export the objects member from the network group in checkpoint management server

Jump to solution

Hello everyone,

 

We need to list all the objects members along with the name and IP-Address from the particular network group to the CSV format. The checkpoint management server is in R80.20 version. Is there any way from commandline or others to exports the object members along with the name and ip address from the particular network group in csv format.

Please help if there is any solution.

@phoneboy 

 

 

 

Thanks 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Admin
Admin

Re: How to list and export the objects member from the network group in checkpoint management server

Jump to solution

With the correct command, it's not difficult to get CSV output:

mgmt_cli -r true show-group name "groupname" --format json | jq '.members[] | [.name, ."ipv4-address"] |@csv' -r

Just to explain:

  • mgmt_cli -r true is how you can utilize the API from a CLI (-r true means "login as root user" which only works on the local management server)
  • show-group is the API command for showing a specific group specified by the name parameter.
  • --format json tells mgmt_cli to output the data in JSON format.
  • jq parses the JSON output from mgmt_cli, in this case pulling out the all the "name" and "ipv4-address" entries from members and outputting to CSV.

View solution in original post

9 Replies
Highlighted

Re: How to list and export the objects member from the network group in checkpoint management server

Jump to solution

Hi,

i am not Phoneboy but nevertheless i take the liberty to answer 😊

I'd suggest to have a look at the R8x-export-import-api-scripts on GitHub.

Cheers
Vincent

and now to something completely different
0 Kudos
Highlighted

Re: How to list and export the objects member from the network group in checkpoint management server

Jump to solution

thanks vincent,

 

but is there documents or process to follow to run this script

0 Kudos
Highlighted
Pearl

Re: How to list and export the objects member from the network group in checkpoint management server

Jump to solution

Consider using JSON over CSV format for exporting group contents that can be nested (groups within groups).

Use the following command on expert mode of your SmartCenter Server to export the first 500 members of a group object:

mgmt_cli login -r true show group name [GROUP] –format json details-level full offset 0 limit 500 –port 443
0 Kudos
Highlighted

Re: How to list and export the objects member from the network group in checkpoint management server

Jump to solution

Thanks Danny

 

let me try this one. i will update you regarding this.

0 Kudos
Highlighted
Admin
Admin

Re: How to list and export the objects member from the network group in checkpoint management server

Jump to solution

With the correct command, it's not difficult to get CSV output:

mgmt_cli -r true show-group name "groupname" --format json | jq '.members[] | [.name, ."ipv4-address"] |@csv' -r

Just to explain:

  • mgmt_cli -r true is how you can utilize the API from a CLI (-r true means "login as root user" which only works on the local management server)
  • show-group is the API command for showing a specific group specified by the name parameter.
  • --format json tells mgmt_cli to output the data in JSON format.
  • jq parses the JSON output from mgmt_cli, in this case pulling out the all the "name" and "ipv4-address" entries from members and outputting to CSV.

View solution in original post

Highlighted

Re: How to list and export the objects member from the network group in checkpoint management server

Jump to solution

Thanks Phoneboy

 

this is what i am looking for 

 

0 Kudos
Highlighted

Re: How to list and export the objects member from the network group in checkpoint management server

Jump to solution

Hi i have been testing this and all looks really good. However what does the @csv command do at the end

i.e. mgmt_cli -r true show-group name "groupname" --format json | jq '.members[] | [.name, ."ipv4-address"] |@csv' -r

I was expecting a csv file to be created but i cant find it

Thanks

0 Kudos
Highlighted
Admin
Admin

Re: How to list and export the objects member from the network group in checkpoint management server

Jump to solution
Normally jq will output results in JSON format.
@csv will convert the output to CSV.
If you want it to a file, you'll have to pipe the output from the command to a file.
Highlighted

Re: How to list and export the objects member from the network group in checkpoint management server

Jump to solution
Thank you for the update
Regards
0 Kudos