.. Document meta
:orphan:
.. |antsibull-internal-nbsp| unicode:: 0xA0
:trim:
.. meta::
:antsibull-docs: 2.14.0
.. Anchors
.. _ansible_collections.middleware_automation.common.tail_grep_module:
.. Anchors: short name for ansible.builtin
.. Title
tail_grep -- Tail a logfile until a regex matcher is found or a timeout triggers
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. Collection note
.. note::
This module is part of the `middleware_automation.common collection `_.
It is not included in ``ansible-core``.
To check whether it is installed, run :code:`ansible-galaxy collection list`.
To install it, use: :code:`ansible-galaxy collection install middleware\_automation.common`.
To use it in a playbook, specify: :code:`middleware_automation.common.tail_grep`.
.. version_added
.. contents::
:local:
:depth: 1
.. Deprecated
Synopsis
--------
.. Description
- This module is used to follow some application logfile and return successfully when a search string or regex is found; otherwise fail after a timeout.
.. Aliases
.. Requirements
.. Options
Parameters
----------
.. raw:: html
Parameter |
Comments |
|
How many seconds to wait after opening the file before starting to look for the regex.
Default: 0
|
|
Backwards from end of file, lines preceeding this string will not be considered for matching regex. By default, the whole file is read. If `$` is used, start from the first line written after the file is opened.
Default: ""
|
|
The file on the remote system to tail.
|
|
The string or regular expression to search in the file.
|
|
After how many seconds to exit unsuccessfully without having found the search regex.
Default: 60
|
.. Attributes
Attributes
----------
.. tabularcolumns:: \X{2}{10}\X{3}{10}\X{5}{10}
.. list-table::
:width: 100%
:widths: auto
:header-rows: 1
:class: longtable ansible-option-table
* - Attribute
- Support
- Description
* - .. raw:: html
.. _ansible_collections.middleware_automation.common.tail_grep_module__attribute-check_mode:
.. rst-class:: ansible-option-title
**check_mode**
.. raw:: html
.. raw:: html
- .. raw:: html
:ansible-attribute-support-label:`Support: \ `\ :ansible-attribute-support-none:`none`
.. raw:: html
- .. raw:: html
Can run in check\_mode and return changed status prediction without modifying target, if not supported the action will be skipped.
.. raw:: html
* - .. raw:: html
.. _ansible_collections.middleware_automation.common.tail_grep_module__attribute-diff_mode:
.. rst-class:: ansible-option-title
**diff_mode**
.. raw:: html
.. raw:: html
- .. raw:: html
:ansible-attribute-support-label:`Support: \ `\ :ansible-attribute-support-none:`none`
.. raw:: html
- .. raw:: html
Will return details on what has changed (or possibly needs changing in check\_mode), when in diff mode
.. raw:: html
* - .. raw:: html
.. _ansible_collections.middleware_automation.common.tail_grep_module__attribute-platform:
.. rst-class:: ansible-option-title
**platform**
.. raw:: html
.. raw:: html
- .. raw:: html
:ansible-attribute-support-property:`Platform:` |antsibull-internal-nbsp|:ansible-attribute-support-full:`posix`
.. raw:: html
- .. raw:: html
Target OS/families that can be operated against
.. raw:: html
.. Notes
.. Seealso
.. Examples
Examples
--------
.. code-block:: yaml+jinja
- name: Tail activemq log until the successful start status code is found
ansible.builtin.tail_grep:
path: /var/log/activemq/artemis.log
regex: AMQ220010
.. Facts
.. Return values
Return Values
-------------
Common return values are documented :ref:`here `, the following are the fields unique to this module:
.. raw:: html
Key |
Description |
|
The full string that was matched by the search regex
Returned: success
Sample: "Application has been started successfully."
|
|
Actual path of file opened
Returned: success
Sample: "/var/log/messages"
|
.. Status (Presently only deprecated)
.. Authors
Authors
~~~~~~~
- Guido Grazioli (@guidograzioli)
.. Extra links
.. Parsing errors