Keep only the last value

Hello everyone,

I use Graylog to push ANSIBLE logs from a whole fleet of Ubuntu client machines. I collect logs in this format:
“Task: Firefox: Creation of pin for installation package successful .”
or
“Task: ‘Update APT cache’ error on the machine adm0848 in room b10hall”
I would like to keep only the status of each task (Successful or Failed) based on the source (the client machine) and the task name. In other words, if a task fails, I am notified, I correct it, I rerun an ansible-pull, and it becomes successful. In my dashboards, I would like the failed task to disappear because the “task name / source machine” association has become successful.

I hope my explanation is clear?

Thank you in advance.

Best regards.

  • OS Information: Debian 12

  • Package Version: 17.0.12 on Linux 6.1.0-25-amd64

Hey there @Julp,

This would be difficult as Graylog isn’t able to alter logs that have been ingested based on an incoming log. For this to work the initial failed log would need to change to reflect that a subsequent attempt at the job has been successful. There is no pipeline to achieve this.

If each job had a unique ID that could be stored as a field, you could write this to a lookup table with either success or failed. Assuming that failed job is rerun and it maintains the same unique ID, if it was successful it would then be reflected within the lookup table. This would be one way of tracking job status.

Hello @Wine_Merchant,

Thank you very much for your quick response.

Each task has a unique name on a unique machine. I have already created my extractors to have keys like this:

ANSIBLE_Etat_tache : Réussie
ANSIBLE_Nom_tache : Configuration apt proxy
source : adm0848
timestamp : 2024-09-18 12:40:24.104

I have “ANSIBLE_Task_Name” and “source” which are unique and keep the same name between two loops.

Do you think I can do something with this?

Thank

A single unique key to lookup would be best. Is separating the success and failed into separate widgets not an option here?

I already have a widget that notifies me of tasks in error for each managed workstation. But I would like that if the tasks in error are corrected and the same task on the same PC becomes ‘successful’, then the error message in the widget disappears. Is that possible

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.