Stay organized with collections
Save and categorize content based on your preferences.
This document describes how you can use natural language prompts to generate
SQL queries for VPC Flow Logs. To generate SQL queries for
VPC Flow Logs, you interact
with Gemini Cloud Assist
in Flow Analyzer.
To interact with Gemini Cloud Assist, use the
pen_sparkCompose a Cloud Assist Query
prompt field. In the prompt field, you can enter a prompt or select a
predefined prompt. The following table provides examples of prompts that
you can use.
Prompt
Generated SQL query
Show me cross-zonal traffic
Selects flows where the source and destination are in
different zones.
Show me resources with SSH traffic
Selects flows with SSH traffic.
Show me the top 10 VMs with the highest traffic
Selects 10 VMs with the highest number of bytes sent.
Show me traffic from and to 10.10.0.10
Selects flows where 10.10.0.10 is the source or
destination IP address.
Show me traffic from example-instance to the internet
Selects flows from the source VM instance named
example-instance to the internet.
Show me traffic from gateways within the last three days
Selects flows within the last three days where VLAN attachments for
Cloud Interconnect and Cloud VPN tunnels are the source.
To generate and run a SQL query, do the following:
In the Google Cloud console, go to the Flow Analyzer page.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Write queries with Gemini assistance\n\n| **Preview\n| --- [Gemini Cloud Assist](/gemini/docs/cloud-assist/overview)**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis document describes how you can use natural language prompts to generate\nSQL queries for VPC Flow Logs. To generate SQL queries for\nVPC Flow Logs, you interact\nwith [Gemini Cloud Assist](/gemini/docs/cloud-assist/overview)\nin Flow Analyzer.\n\nLearn [how and when Gemini\nfor Google Cloud uses your data](/gemini/docs/discover/data-governance).\n\nBefore you begin\n----------------\n\n- [Set up Gemini Cloud Assist](/gemini/docs/cloud-assist/set-up-gemini)\n in a Google Cloud project that contains a Cloud Logging bucket with flow\n logs.\n\n- Make sure that the log bucket is\n [upgraded to use Log Analytics](/logging/docs/buckets#upgrade-bucket)\n and you have the\n [required roles and permissions](/network-intelligence-center/docs/flow-analyzer/analyze-traffic-flows#required_roles_and_permissions)\n to query the flow logs.\n\nGenerate a SQL query\n--------------------\n\n| As an early-stage technology, Gemini for Google Cloud\n| products can generate output that seems plausible but is factually incorrect. We recommend that you\n| validate all output from Gemini for Google Cloud products before you use it.\n| For more information, see\n| [Gemini for Google Cloud and responsible AI](/gemini/docs/discover/responsible-ai).\n\nTo interact with Gemini Cloud Assist, use the\npen_spark**Compose a Cloud Assist Query**\nprompt field. In the prompt field, you can enter a prompt or select a\npredefined prompt. The following table provides examples of prompts that\nyou can use.\n\nTo generate and run a SQL query, do the following:\n\n1. In the Google Cloud console, go to the **Flow Analyzer** page.\n\n [Go to Flow Analyzer](https://console.cloud.google.com/net-intelligence/flow-analyzer)\n2. Click pen_spark**Compose a Cloud\n Assist Query**.\n\n3. Describe the log data that you want to view or\n select a predefined prompt.\n\n4. Click **Generate SQL**.\n\n5. Review the response and run the query:\n\n - To run the query in Flow Analyzer, click the **Explore in Flow Analyzer** tab and then click **Open in Flow Analyzer**.\n - To run the query in Log Analytics, click the **Run SQL in Log Analytics** tab and then click **Run SQL in Log Analytics**.\n\nAfter you run the query, you can optionally modify the populated\nvalues as needed.\n\nWhat's next\n-----------\n\n- Read [Gemini for Google Cloud overview](/gemini/docs/overview).\n- Learn [how Gemini for Google Cloud uses your data](/gemini/docs/discover/data-governance)."]]