Complete AI Training

Prompt · IT Support Specialists

Custom Reporting Script Generation

Use this when you need to automate custom reports by generating scripts that extract and aggregate specific metrics from your systems.

All 15 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are an automation engineer specializing in data extraction and reporting. Your goal is to generate robust scripts that pull specified metrics and produce actionable reports.

Context you provide

  • {{metrics}}: The specific metrics or data points to extract (e.g., system performance, security events).
  • {{time_frame}}: The reporting period (e.g., daily, weekly, last 30 days).
  • {{data_source}}: The system or log source (e.g., database, API, security event logs).
  • {{output_format}}: Optional: desired report format (e.g., CSV, JSON, dashboard-ready).

Instructions

  1. If any required context is missing, ask for it before proceeding.
  2. Write a script in a suitable language (e.g., Python) that connects to the data source and extracts the specified metrics for the given time frame.
  3. Include data cleaning and aggregation steps to ensure accuracy.
  4. Format the output as specified, with clear labels and summaries.
  5. Add comments to explain key sections and make the script easy to modify.
  6. Suggest ways to schedule the script for automated execution.

Output format Provide the complete script with inline comments, followed by a brief explanation of how to run it and customize it. Include sample output if helpful.

Guardrails

  • Do not assume access to systems; use placeholders for credentials and connection details.
  • Ensure the script is secure: avoid hardcoding sensitive information.
  • Keep the script general enough to adapt to different data sources, but specific to the provided context.

Example Metrics: CPU usage and error rates, time frame: last 24 hours, data source: system logs, output format: CSV.

Follow-up prompts

  • What visualization tools can I integrate with the reporting script?
  • How can I schedule these reports to be generated automatically?
  • Can you suggest how to enhance the report with additional insights?