:source: fmgd_log_setting.py
:orphan:
.. _fmgd_log_setting:
fmgd_log_setting -- Configure general log settings.
+++++++++++++++++++++++++++++++++++++++++++++++++++
.. versionadded:: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- This module is able to configure a FortiManager device.
- Examples include all parameters and values need to be adjusted to data sources before usage.
- Tested with FortiManager v7.x.
Requirements
------------
The below requirements are needed on the host that executes this module.
- ansible-core>=2.16.0
FortiManager Version Compatibility
----------------------------------
.. raw:: html
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
Parameters
----------
.. raw:: html
- access_token -The token to access FortiManager without using username and password. type: str required: false
- bypass_validation - Only set to True when module schema diffs with FortiManager API structure, module continues to execute without validating parameters. type: bool required: false default: False
- enable_log - Enable/Disable logging for task. type: bool required: false default: False
- forticloud_access_token - Access token of forticloud managed API users, this option is available with FortiManager later than 6.4.0. type: str required: false
- proposed_method - The overridden method for the underlying Json RPC request. type: str required: false choices: set, update, add
- rc_succeeded - The rc codes list with which the conditions to succeed will be overriden. type: list required: false
- rc_failed - The rc codes list with which the conditions to fail will be overriden. type: list required: false
- workspace_locking_adom - Acquire the workspace lock if FortiManager is running in workspace mode. type: str required: false choices: global, custom adom including root
- workspace_locking_timeout - The maximum time in seconds to wait for other users to release workspace lock. type: integer required: false default: 300
- device - The parameter in requested url type: str required: true
- vdom - The parameter in requested url type: str required: true
- log_setting - Configure general log settings. type: dict
- anonymization_hash (Alias name: anonymization-hash) User name anonymization hash salt. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- brief_traffic_format (Alias name: brief-traffic-format) Enable/disable brief format traffic logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- custom_log_fields (Alias name: custom-log-fields) Custom fields to append to all log messages. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- daemon_log (Alias name: daemon-log) Enable/disable daemon logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- expolicy_implicit_log (Alias name: expolicy-implicit-log) Enable/disable explicit proxy firewall implicit policy logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- extended_log (Alias name: extended-log) Enable/disable extended traffic logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.3 -> latest
- faz_override (Alias name: faz-override) Enable/disable override fortianalyzer settings. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- fortiview_weekly_data (Alias name: fortiview-weekly-data) Enable/disable fortiview weekly data. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- fwpolicy_implicit_log (Alias name: fwpolicy-implicit-log) Enable/disable implicit firewall policy logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- fwpolicy6_implicit_log (Alias name: fwpolicy6-implicit-log) Enable/disable implicit firewall policy6 logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- local_in_allow (Alias name: local-in-allow) Enable/disable local-in-allow logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- local_in_deny_broadcast (Alias name: local-in-deny-broadcast) Enable/disable local-in-deny-broadcast logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- local_in_deny_unicast (Alias name: local-in-deny-unicast) Enable/disable local-in-deny-unicast logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- local_out (Alias name: local-out) Enable/disable local-out logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- local_out_ioc_detection (Alias name: local-out-ioc-detection) Enable/disable local-out traffic ioc detection. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- log_policy_comment (Alias name: log-policy-comment) Enable/disable inserting policy comments into traffic logs. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- log_user_in_upper (Alias name: log-user-in-upper) Enable/disable logs with user-in-upper. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- long_live_session_stat (Alias name: long-live-session-stat) Enable/disable long-live-session statistics logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.3 -> latest
- neighbor_event (Alias name: neighbor-event) Enable/disable neighbor event logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- resolve_ip (Alias name: resolve-ip) Enable/disable adding resolved domain names to traffic logs if possible. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- resolve_port (Alias name: resolve-port) Enable/disable adding resolved service names to traffic logs. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- rest_api_get (Alias name: rest-api-get) Enable/disable rest api get request logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- rest_api_set (Alias name: rest-api-set) Enable/disable rest api post/put/delete request logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- syslog_override (Alias name: syslog-override) Enable/disable override syslog settings. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- user_anonymize (Alias name: user-anonymize) Enable/disable anonymizing user names in log messages. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- log_invalid_packet (Alias name: log-invalid-packet) Enable/disable invalid packet traffic logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- log_policy_name (Alias name: log-policy-name) Enable/disable inserting policy name into traffic logs. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> v7.6.2
- extended_utm_log (Alias name: extended-utm-log) Enable/disable extended utm logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.6.0 -> latest
- local_in_policy_log (Alias name: local-in-policy-log) Enable/disable local-in-policy logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.6.0 -> latest
- rest_api_performance (Alias name: rest-api-performance) Enable/disable rest api memory and performance stats in rest-api-get/set logs. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.5 -> latest
- zone_name (Alias name: zone-name) Enable/disable zone name logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.6.4 -> latest
- web_svc_perf (Alias name: web-svc-perf) Enable/disable web-svc performance logging. type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.4.9 -> v7.4.10, v7.6.5 -> latest
Notes
-----
.. note::
- Running in workspace locking mode is supported in this FortiManager module, the top level parameters workspace_locking_adom and workspace_locking_timeout help do the work.
- To create or update an object, use state: present directive.
- To delete an object, use state: absent directive
- Normally, running one module can fail when a non-zero rc is returned. you can also override the conditions to fail or succeed with parameters rc_failed and rc_succeeded
Examples
--------
.. code-block:: yaml+jinja
- name: Example playbook (generated based on argument schema)
hosts: fortimanagers
connection: httpapi
gather_facts: false
vars:
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
ansible_httpapi_port: 443
tasks:
- name: Configure general log settings.
fortinet.fmgdevice.fmgd_log_setting:
# bypass_validation: false
# workspace_locking_adom:
# workspace_locking_timeout: 300
# rc_succeeded: [0, -2, -3, ...]
# rc_failed: [-2, -3, ...]
device:
vdom:
log_setting:
# anonymization_hash:
# brief_traffic_format:
# custom_log_fields:
# daemon_log:
# expolicy_implicit_log:
# extended_log:
# faz_override:
# fortiview_weekly_data:
# fwpolicy_implicit_log:
# fwpolicy6_implicit_log:
# local_in_allow:
# local_in_deny_broadcast:
# local_in_deny_unicast:
# local_out:
# local_out_ioc_detection:
# log_policy_comment:
# log_user_in_upper:
# long_live_session_stat:
# neighbor_event:
# resolve_ip:
# resolve_port:
# rest_api_get:
# rest_api_set:
# syslog_override:
# user_anonymize:
# log_invalid_packet:
# log_policy_name:
# extended_utm_log:
# local_in_policy_log:
# rest_api_performance:
# zone_name:
# web_svc_perf:
Return Values
-------------
Common return values are documented: https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values, the following are the fields unique to this module:
.. raw:: html
- meta - The result of the request.returned: always type: dict
- request_url - The full url requested. returned: always type: str sample: /sys/login/user
- response_code - The status of api request. returned: always type: int sample: 0
- response_data - The data body of the api response. returned: optional type: list or dict
- response_message - The descriptive message of the api response. returned: always type: str sample: OK
- system_information - The information of the target system. returned: always type: dict
- rc - The status the request. returned: always type: int sample: 0
- version_check_warning - Warning if the parameters used in the playbook are not supported by the current FortiManager version. returned: if at least one parameter not supported by the current FortiManager version type: list
Status
------
- This module is not guaranteed to have a backwards compatible interface.
Authors
-------
- Xinwei Du (@dux-fortinet)
- Xing Li (@lix-fortinet)
- Jie Xue (@JieX19)
- Link Zheng (@chillancezen)
- Frank Shen (@fshen01)
- Hongbin Lu (@fgtdev-hblu)