Using Ansible to export stats-dump with specific time range

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using Ansible to export stats-dump with specific time range

L0 Member

Good morning, LIVE Community.

 

I'm trying to export stats-dump from a remote PaloAlto device to my local computer using Ansible.

Prior to trying out Ansible, I'd usually use this command on the remote device to export stats-dump to my computer:

scp export stats-dump remote-port <remote_port>start-time equal <YYYY>/<MM>/<DD>@00:00:00end-time equal <YYYY>/<MM>/<DD>@00:00:00to <username>@<remote_host>:<path/to/remote/file>

 

I tried using the panos_export module, and it worked. But there is a problem, namely I can't seem to specify the time range for my stats-dump? Here is my Ansible playbook.

 

---
- name: Export configuration
  hosts: all
  connection: local
  gather_facts: False

  collections:
  - paloaltonetworks.panos

  tasks:
  - name: Load variable
    include_vars: vars.yml

  - name: Get stats-dump file
    panos_export:
      provider: '{{provider}}'
      category: 'stats-dump'
      filename: '/home/ops-user/temp'

 

 

I know that by default, stats-dump would collect data for the last 7 days. If I want my stats-dump to collect data for the last month, is there a way to specify the time range in the Ansible playbook?

 

Any help would be appreciated.

 

Regards

1 REPLY 1

Cyber Elite
Cyber Elite

@agatha,

Just a brief glance there doesn't appear to be a way to customize this. Could you just use the XML-API and make the same call you were using previously? 

  • 1215 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!