如何通过检索系统日志API称呼

如何通过检索系统日志API称呼

10599
Created On 04/27/23 17:02 PM - Last Modified 05/02/23 06:19 AM


Objective


通过以下方式检索系统日志API称呼。

Environment


  • 帕洛阿尔托Firewall或者 Panorama
  • PANOS 8.1 及更高版本
  • 系统日志
  • API


Procedure


该功能是直接从 Web 浏览器使用 https 命令执行的。
  1. 获得授权API后续使用的keyAPI命令。 下面命令。
https://10.46.34.37/api/?type=keygen&user=admin&password=123456789
Output: 
<response status="success">
<result>
<key>
LUF3042987010WVNaGp6344628UFwbGhkMm30429870101276344628TNaS1MyYQ==
</key>
</result>
</response>
 
  1. 发出API特定作业的系统日志命令ID.
笔记: 使用Firewall管理IP对于 <Firewall_IP>;和API第 1 步中的密钥。

示例:使用实验室firewallJobID 为 7。
https://10.46.34.37/api/?type=log&log-type=system&query=(description contains 'JobId=7')&key=LUF3042987010WVNaGp6344628UFwbGhkMm30429870101276344628TNaS1MyYQ== 

<response status="success" code="19">
<result>
<msg>
<line>query job enqueued with jobid 23</line> >>>> Note the job ID to be used for the query
</msg>
<job>23</job>
</result>
</response>
 
  1. 发出API下面的命令替换上面步骤 (2) 中学习的作业 ID,以检索和显示从作业开始的系统日志输出。 在此示例中,jobid = 23

例子:

https://10.46.34.37/api/?type=log&action=get&;job-id=23&key=LUF3042987010WVNaGp6344628UFwbGhkMm30429870101276344628TNaS1MyYQ== 

<response status="success">
<result>
<job>
<tenq>14:38:45</tenq>
<tdeq>14:38:45</tdeq>
<tlast>14:38:45</tlast>
<status>FIN</status>
<id>23</id>
</job>
<log>
<logs count="20" progress="100">
<entry logid="7221688578500198765">
<domain>1</domain>
<receive_time>2023/04/13 22:11:57</receive_time>
<serial>001801010900</serial>
<seqno>480378</seqno>
<actionflags>0x0</actionflags>
<is-logging-service>no</is-logging-service>
<type>SYSTEM</type>
<subtype>general</subtype>
<config_ver>0</config_ver>
<time_generated>2023/04/13 22:11:57</time_generated>
<dg_hier_level_1>0</dg_hier_level_1>
<dg_hier_level_2>0</dg_hier_level_2>
<dg_hier_level_3>0</dg_hier_level_3>
<dg_hier_level_4>0</dg_hier_level_4>
<device_name>Lab34-37-PA-3020</device_name>
<vsys_id>0</vsys_id>
<eventid>general</eventid>
<fmt>0</fmt>
<id>0</id>
<module>general</module>
<severity>informational</severity>
<opaque>Commit job succeeded. Completion time=2023/04/13 22:11:57. JobId=7. User:admin</opaque>
</entry>

 


Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u000000g1YbCAI&lang=zh_CN&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail

Choose Language