diff --git a/src/content/docs/data-reporting/scheduled-queries.mdx b/src/content/docs/data-reporting/scheduled-queries.mdx new file mode 100644 index 00000000000..5b3b361bb26 --- /dev/null +++ b/src/content/docs/data-reporting/scheduled-queries.mdx @@ -0,0 +1,212 @@ +--- +title: Schedule NRQL queries +tags: + - Data reporting + - Scheduled queries + - NRQL automation + - Email delivery + - Query scheduling + - Workflow automation +metaDescription: "Automate your NRQL queries by scheduling them to run on a recurring basis and receive results via email." +freshnessValidatedDate: never +--- + +As a New Relic user, you may need to run the same NRQL queries repeatedly to monitor system performance, track trends, or generate regular reports. Manually executing these queries on a daily, weekly, or monthly basis is time-consuming and prone to oversight, especially when you need to share results with team members or stakeholders who aren't actively using New Relic. + +Scheduled NRQL queries solve this problem by automating your query execution. You can schedule any NRQL query to run automatically at specified intervals and have the results delivered directly to email recipients, so you'll receive timely insights without manual effort. + + +We're still working on this feature, but we'd love for you to try it out! +This feature is currently provided as part of a preview program pursuant to our [pre-release +policies](/docs/licenses/license-information/referenced-policies/new-relic-pre-release-policy). + + +## What you can do + +With scheduled NRQL queries, you can: + +- **Automate repetitive queries**: Transform manual, repetitive NRQL queries into automated workflows that run on your schedule +- **Schedule flexible intervals**: Set queries to run using cron expressions for precise timing control +- **Deliver results via email**: Send query results as CSV or JSON attachments to specified email recipients +- **Query any data type**: While the initial entry point is through the Logs UI, you can schedule queries for any New Relic data (logs, metrics, events, transactions) +- **Manage centrally**: View, edit, delete, and duplicate all your scheduled queries from a central administration interface + +## Pricing + +Scheduled NRQL queries is an Advanced Compute Product feature offered as an +[add-on](/docs/accounts/accounts-billing/new-relic-one-pricing-billing/add-on-billing) or as a part of the Compute pricing model. Advanced +[CCUs](/docs/licenses/license-information/product-definitions/new-relic-one-pricing-definitions/#compute-capacity-unit) are consumed when queries are executed on their scheduled intervals. + +## Prerequisites + +To use scheduled NRQL queries, you need: + +- A New Relic account with Pro or Enterprise pricing tier +- [Workflow automation capabilities](/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/#permissions) permissions +- Access to the data you want to query (account-level access and any applicable data partition permissions) + +## Access scheduled queries + +To access scheduled queries: + +1. Go to **[one.newrelic.com](https://one.newrelic.com) > Administration > All capabilities**. +2. Select **Scheduled searches**. + +When you first visit this page, you'll see an empty state with the option to **Schedule a search**. + +## Create a scheduled query + +You can create scheduled queries from two entry points: + + + + From Logs UI + From Administration + + + + +### From the Logs UI + +1. Go to **[one.newrelic.com](https://one.newrelic.com) > Logs**. +2. Create or refine your NRQL query in the logs interface. +3. Click the menu and select **Schedule search**, or click the clock icon. +4. The query from your current log view will be automatically pre-populated. +5. Continue with the configuration steps below. + + + + +### From Administration + +1. Go to **[one.newrelic.com](https://one.newrelic.com) > Administration > All capabilities**. +2. Select **Scheduled searches**. +3. Click **Schedule a search**. +4. Enter your NRQL query manually. +5. Continue with the configuration steps below. + + + + + +## Configure your scheduled query + + + +### Define your query + +1. **Name your search**: Enter a descriptive name for your scheduled query. +2. **Edit your query**: Review and modify the NRQL query as needed. You can query any New Relic data type, not just logs. +3. **Test your query**: Click **Run query** to preview the results and ensure your query works correctly. + +The query builder includes the same autocomplete functionality available in other New Relic query interfaces. + + + +### Configure notifications + +1. **Choose destination**: Select either an existing email destination from your alerts configuration or add a new destination. +2. **Add email addresses**: If creating a new destination, enter the email addresses that should receive the results. +3. **Customize email content**: + - **Subject**: Customize the email subject line (defaults to your search name and date) + - **Body**: Add custom text to the email body, including variables like `{{Search_name}}` +4. **Select output format**: Choose what to include in the email: + - **CSV attachment**: Query results as a downloadable CSV file + - **JSON attachment**: Query results in JSON format + - **Search link**: A permalink back to the exact query in New Relic + + + +### Set your schedule + +Configure when your query should run: + +1. **Cron expression**: Enter a cron expression to define your schedule timing. +2. **Time zone**: Specify the time zone for your scheduled query. +3. **Threshold options**: Choose when to send notifications: + - **Send every time**: Deliver results every time the query runs + - **Send only when results exist**: Only send emails when the query returns data (result count > 0) + +The interface will display your cron expression in plain English to help you validate the timing (for example, "0 0 * * 2" displays as "Every Tuesday at 12am"). + + +Common cron expression examples: +- `0 9 * * 1-5`: Every weekday at 9 AM +- `0 0 * * 0`: Every Sunday at midnight +- `0 */6 * * *`: Every 6 hours +- `0 0 1 * *`: First day of every month at midnight + + + + +### Review and create + +1. Review all your configuration settings. +2. Click **Create scheduled search**. +3. You'll see a confirmation message that your scheduled search has been created. + + + +## Manage scheduled queries + +### View your scheduled queries + +Go to **[one.newrelic.com](https://one.newrelic.com) > Administration > All capabilities > Scheduled searches** to see all your scheduled queries with details including: + +- Name and description +- Destination type (email) +- Schedule frequency +- Last run time +- Status (active, paused, etc.) + +### Edit a scheduled query + + + +From the scheduled searches list, click the menu next to the query you want to modify. + + +Select **Edit** to modify any aspect of your scheduled query including the NRQL query, schedule, destinations, or notification settings. + + +Save your changes when complete. + + + +### Other management options + +From the scheduled searches list, you can: + +- **Duplicate**: Create a copy of an existing scheduled query as a starting point for a new one +- **Pause/Resume**: Temporarily disable a scheduled query without deleting the configuration +- **Delete**: Permanently remove a scheduled query +- **Manual trigger**: Run a scheduled query immediately outside of its regular schedule + +## Related topics + + + + Learn how to use the Logs UI, where you can access the Schedule search option. + + + Learn more about NRQL, New Relic's query language used in scheduled queries. + + + Understand the underlying workflow automation capabilities that power scheduled queries. + + + Learn about configuring email destinations used for scheduled query results. + + \ No newline at end of file diff --git a/src/nav/data-reporting.yml b/src/nav/data-reporting.yml new file mode 100644 index 00000000000..8ca68c5d87b --- /dev/null +++ b/src/nav/data-reporting.yml @@ -0,0 +1,5 @@ +title: Data reporting +path: /docs/data-reporting +pages: + - title: Schedule NRQL queries + path: /docs/data-reporting/scheduled-queries \ No newline at end of file diff --git a/src/nav/logs.yml b/src/nav/logs.yml index b1cfcf78a21..9ea89412e87 100644 --- a/src/nav/logs.yml +++ b/src/nav/logs.yml @@ -94,6 +94,8 @@ pages: pages: - title: Logs UI path: /docs/logs/ui-data/use-logs-ui + - title: Schedule NRQL queries + path: /docs/data-reporting/scheduled-queries - title: Logs release notes path: /docs/release-notes/logs-release-notes - title: Log patterns diff --git a/src/nav/root.yml b/src/nav/root.yml index 4ee991c1075..9a1601da6f8 100644 --- a/src/nav/root.yml +++ b/src/nav/root.yml @@ -46,6 +46,8 @@ pages: - title: Website performance monitoring path: website-performance-monitoring - title: Data insights + - title: Data reporting + path: data-reporting - title: Agentic AI path: agentic-ai - title: Alerts