[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[],[],null,["This page explains how to enable network policy logging in a Google Distributed Cloud\nuser cluster and how to export logs. See [Using network policy\nlogging](/kubernetes-engine/docs/how-to/network-policy-logging) to learn how to configure which events are logged and how logs are formatted.\n\nOverview\n\n[Network\npolicies](https://kubernetes.io/docs/concepts/services-networking/network-policies/)\nare Pod-level firewalls; they specify network traffic that Pods are allowed to\nsend and receive. Network policy logs record network policy events. You can\nlog all events or you can [configure logging\nselectively](/kubernetes-engine/docs/how-to/network-policy-logging#configuring_network_policy_logging)\nbased on the following criteria:\n\n- Allowed connections.\n- Denied connections.\n- Connections allowed by specific policies.\n- Denied connections to Pods in specific namespaces.\n\nBefore you begin\n\nNetwork policy logging is supported in user clusters that use\n[Dataplane V2](/kubernetes-engine/docs/how-to/dataplane-v2). You can enable\nDataplane V2 when creating a new user cluster by using the\n[`enableDataplaneV2`](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/user-cluster-configuration-file-latest#enabledataplanev2-field)\nfield in the user cluster configuration file.\n\nEnabling logging\n\nNetwork policy logging is not enabled by default. For information on enabling\nlogging and selecting which events to log, see [Configuring network policy\nlogging](/kubernetes-engine/docs/how-to/network-policy-logging#configuring_network_policy_logging).\n\nAccessing logs\n\nThe network policy logs generated on each cluster node are available locally on\nthe cluster nodes at\n`/var/log/network/policy_action`\u003cvar translate=\"no\"\u003etimestamp\u003c/var\u003e`.log`. A new\ntimestamped log file is created when the current log file reaches 10 MB. Up to\nfive previous log files are stored.\n\nExporting logs\n\nWe recommend you use [Fluent Bit](https://fluentbit.io/) to export\nlogs from your cluster nodes. Fluent Bit is an open source log processor\nand forwarder that supports exporting to\nCloud Logging and many [other data\nsinks](https://docs.fluentbit.io/manual/pipeline/outputs).\n\nWhat's next\n\n- Learn [how to configure network policy logging](/kubernetes-engine/docs/how-to/network-policy-logging)\n- Learn how to [create a network policy](/kubernetes-engine/docs/how-to/network-policy)"]]