Searching the content of Puppet agent reports with Foreman 1.12?

Problem:

I’m preparing to upgrade an older Puppet 3.8 & Foreman 1.12 server to a newer version of Puppet & Foreman. Before we upgrade, we need to find and fix all deprecated code, as well as fix other issues that we find in the logs.

Can I search the content of the reports using Foreman? For example, can I search for a string which says something like “Passing port to firewall is deprecated” across all my nodes?

Foreman and Proxy versions:

Foreman 1.12 & 1.12

Yes, through the API, api/v2/config_reports/3115 (for example) contains a field called logs. If I’m not wrong you should be able to pass queries like eventful = true and log ~ PULP_MANIFEST but apparently searching the logs is broken in nightly, might be working on 1.12 though.

{

    "metrics": {
        "time": {
            "total": 15
        }
    },
    "created_at": "2018-07-05 15:19:08 +0200",
    "updated_at": "2018-07-05 15:19:08 +0200",
    "id": 3115,
    "host_id": 3,
    "host_name": "centos7-devel.lobatolan.home",
    "reported_at": "2018-07-05 17:17:32 +0200",
    "status": {
        "applied": 1,
        "restarted": 0,
        "failed": 0,
        "failed_restarts": 0,
        "skipped": 0,
        "pending": 0
    },
    "logs": [
        {
            "level": "notice",
            "source": {
                "source": "command"
            },
            "message": {
                "message": "{\"changed\": true, \"end\": \"2018-07-05 13:19:08.005797\", \"stdout\": \"anaconda-ks.cfg\\nkatello-certs-1.0.0.tar.gz\\nPULP_MANIFEST\\npuppet-certs\\nssl-build\\nssl-build-bak\", \"cmd\": \"ls ~\", \"rc\": 0, \"start\": \"2018-07-05 13:19:08.001519\", \"stderr\": \"\", \"delta\": \"0:00:00.004278\", \"invocation\": {\"module_args\": {\"creates\": null, \"executable\": null, \"_uses_shell\": true, \"_raw_params\": \"ls ~\", \"removes\": null, \"warn\": true, \"chdir\": null, \"stdin\": null}}, \"_ansible_parsed\": true, \"stdout_lines\": [\"anaconda-ks.cfg\", \"katello-certs-1.0.0.tar.gz\", \"PULP_MANIFEST\", \"puppet-certs\", \"ssl-build\", \"ssl-build-bak\"], \"stderr_lines\": [], \"_ansible_no_log\": false}"
            }
        },
        {
            "level": "info",
            "source": {
                "source": "debug"
            },
            "message": {
                "message": "{\"out\": {\"changed\": true, \"end\": \"2018-07-05 13:19:08.005797\", \"stdout\": \"anaconda-ks.cfg\\nkatello-certs-1.0.0.tar.gz\\nPULP_MANIFEST\\npuppet-certs\\nssl-build\\nssl-build-bak\", \"cmd\": \"ls ~\", \"rc\": 0, \"start\": \"2018-07-05 13:19:08.001519\", \"stderr\": \"\", \"delta\": \"0:00:00.004278\", \"stdout_lines\": [\"anaconda-ks.cfg\", \"katello-certs-1.0.0.tar.gz\", \"PULP_MANIFEST\", \"puppet-certs\", \"ssl-build\", \"ssl-build-bak\"], \"stderr_lines\": [], \"failed\": false}, \"_ansible_verbose_always\": true, \"_ansible_no_log\": false, \"changed\": false}"
            }
        }
    ],
    "summary": "Modified"

}

Searching for this results in ‘No entries found’. We don’t actually use Pulp here, and PULP_MANIFEST doesn’t seem to be a thing in the Foreman API or WebUI.

In the API, each report does indeed contain a field called logs. The content of /api/v2/config_reports/5147320 and /config_reports/5147320 are the same.

Just to be clear, I was hoping to search across all reports for all hosts, sort of like a searching for a message using a big grep --recursive SomeString /var/log.