Disattivazione e attivazione dei log delle modifiche dello stato di integrità
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Per impostazione predefinita, Compute Engine registra le modifiche dello stato di integrità del gruppo di istanze gestite
quando configuri un controllo di integrità
basato sull'applicazione per il gruppo. Tuttavia, puoi disattivare i log se vuoi ridurre i costi di registrazione
o se non hai requisiti specifici per registrare le modifiche dello
stato di integrità.
Disattivazione dei log delle modifiche dello stato di integrità
Per disattivare i log relativi alla modifica dello stato di integrità, utilizza le Esclusioni dei log
per creare un filtro di esclusione che elimini i log.
Console
Vai alla pagina Router dei log nella Google Cloud console.
Nella riga del bucket di log _Default, fai clic sul
menu
more_vert e poi seleziona Modifica sink.
Nella sezione Scegli i log da escludere dal sink, fai clic su Aggiungi esclusione.
Nel campo Nome filtro di esclusione, specifica un nome per il filtro.
Crea il seguente filtro di esclusione:
logName="projects/PROJECT_ID/logs/compute.googleapis.com%2Finstance_group_manager_events" AND
jsonPayload.instanceHealthStateChange:"*"
Per salvare le modifiche, fai clic su Aggiorna sink.
Dopo aver salvato le modifiche, Compute Engine inizia a filtrare i
log di variazione dello stato di integrità dell'istanza. Per scoprire di più, consulta Gestione dei sink
e Creazione di filtri di esclusione.
Attivazione dei log delle modifiche dello stato di integrità
Puoi attivare i log di modifica dello stato di salute dell'istanza disattivati in precedenza o
rimuovere il filtro di esclusione aggiunto in precedenza per
disattivare i log.
Console
Per attivare il logging delle modifiche dello stato di integrità:
Vai alla pagina Router dei log nella Google Cloud console.
Nella riga del bucket di log _Default, fai clic sul
menu
more_vert e poi seleziona Modifica sink.
Nella sezione Scegli i log da escludere dal sink, fai clic su Disattiva
accanto al filtro di esclusione che esclude i log di modifica dello
stato di integrità dell'istanza. Puoi anche eliminare il filtro di esclusione se
non ti serve più.
Fai clic su Aggiorna il sink per salvare le modifiche.
Dopo aver salvato le modifiche, Compute Engine inizia a registrare le modifiche
dello stato di integrità. Per ulteriori informazioni sulle voci di log, consulta
Formato delle voci di log.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eCompute Engine, by default, logs health state changes of managed instance groups when application-based health checks are configured, but these logs can be disabled.\u003c/p\u003e\n"],["\u003cp\u003eDisabling health state change logs can be achieved by creating an exclusion filter in the Logs Router, using a specific filter targeting \u003ccode\u003ecompute.googleapis.com%2Finstance_group_manager_events\u003c/code\u003e and \u003ccode\u003ejsonPayload.instanceHealthStateChange\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo re-enable previously disabled health state change logs, you can disable or delete the corresponding exclusion filter in the Logs Router.\u003c/p\u003e\n"],["\u003cp\u003eCompute Engine will start or stop logging health state changes for managed instance groups immediately upon updating the exclusion filter settings.\u003c/p\u003e\n"]]],[],null,["*** ** * ** ***\n\nBy default, Compute Engine logs health state changes of your managed instance\ngroup when you configure application-based [health check](/compute/docs/instance-groups/autohealing-instances-in-migs#setting_up_an_autohealing_policy)\nfor the group. However, you can disable the logs if you want to reduce the\nlogging costs or don't have any specific requirement to log the health state\nchanges.\n\nFor logs of load balancer health checks, see [load balancer's health check logging](/load-balancing/docs/health-check-logging).\n\nBefore you begin\n\n- Read the [Logs exclusion](/logging/docs/exclusions) documentation.\n- Review the [Cloud Logging pricing](/stackdriver/pricing).\n\nDisabling health state change logs\n\nTo disable the health state change logs, use the [Logs exclusions](/logging/docs/exclusions)\nto create an exclusion filter that discards the logs. \n\nConsole\n\n1. Go to the **Logs Router** page in the Google Cloud console.\n\n [Go to Logs Router](https://console.cloud.google.com/logs/router)\n2. In the `_Default` logging bucket row, click the\n *more_vert* menu\n and then select **Edit sink**.\n\n3. In the **Choose logs to filter out of sink** section, click **Add exclusion**.\n\n4. In the **Exclusion filter name** field, specify a name for your filter.\n\n5. Build the following exclusion filter:\n\n ```\n logName=\"projects/PROJECT_ID/logs/compute.googleapis.com%2Finstance_group_manager_events\" AND\n jsonPayload.instanceHealthStateChange:\"*\"\n ```\n6. To save the changes, click **Update sink**.\n\n After you save the changes, Compute Engine begins to filter out the instance\n health state change logs. To learn more, see [Managing sinks](/logging/docs/export/configure_export_v2#managing_sinks)\n and [Creating exclusion filters](/logging/docs/exclusions#create-filter-existing).\n\nEnabling health state change logs\n\nYou can enable any previously disabled instance health state change logs or\nremove the exclusion filter that you added earlier to\n[disable the logs](#disabling_health_state_change_logs). \n\nConsole\n\nTo enable health state change logging, do the following:\n\n1. Go to the **Logs Router** page in the Google Cloud console.\n\n [Go to Logs Router](https://console.cloud.google.com/logs/router)\n2. In the `_Default` logging bucket row, click the\n *more_vert* menu\n and then select **Edit sink**.\n\n3. In the **Choose logs to filter out of sink** section, click **Disable**\n next to the exclusion filter that filters out instance health state\n change logs. You can also **Delete** the exclusion filter if you no longer\n need it.\n\n | **Note:** Check all your exclusion filters because the same log entries could be targeted by more than one filter.\n4. Click **Update sink** to save the changes.\n\n After you save the changes, Compute Engine begins to log the health\n state changes. For more information about log entries, see\n [Format of log entries](/compute/docs/instance-groups/monitoring-managed-instance-health-state-changes#what_is_logged).\n\nTo learn more, see [Managing sinks](/logging/docs/export/configure_export_v2#managing_sinks)\nand [Removing exclusions](/logging/docs/exclusions#stopping-resource).\n\nWhat's next\n\n- [Monitoring managed instance health state changes](/compute/docs/instance-groups/monitoring-managed-instance-health-state-changes)\n- [What makes a good autohealing health check](/compute/docs/instance-groups/autohealing-instances-in-migs#what_makes_a_good_autohealing_health_check)."]]