# Loggly MCP for AI Agents AI Agent Connect

> Loggly MCP lets you manage cloud logs via your AI agent. You can send events, run Lucene searches, and check infrastructure metrics without leaving your chat interface. It connects your Loggly account to your agent so you can find errors and monitor performance using natural language.

## Overview
- **Category:** devops-cicd
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_YERVkwYlKRCd9QDot0W95wUjp0DxrokEefz1j8us/ai-agent-connect
- **Tags:** logging, analytics, lucene-search, cloud-monitoring, log-analysis

## Description

Loggly MCP lets you manage cloud logs via your AI agent. Imagine you are in the middle of a production outage. Instead of frantically switching between browser tabs and trying to remember specific Lucene queries, you just ask your agent what is going on. This Connector connects your Loggly account directly to your AI client, turning your chat window into a command center for your logs. You can ask it to find specific error patterns from the last hour, check if a specific service is spiking in traffic, or see how many users are hitting a certain endpoint. It handles the heavy lifting of querying and filtering, presenting you with the data you actually need to make a decision. When you find a recurring issue, you can even tell your agent to send a new debug event with specific JSON data to see if the fix holds up. It is a huge shift from manual searching to proactive monitoring. By adding this to your Vinkius catalog, you get a way to manage your entire observability stack through a single conversation. You stop being a person who copies and pastes log IDs and start being the person who actually solves the problem. You can even check your subscription limits or see who has access to your organization to keep things organized. It puts the power of cloud logging into a simple chat interface where you can stay focused on fixing things rather than hunting for them.

## Tools

### get_customer_info
Get your account details from Loggly. This helps you keep track of your subscription status and limits.

### get_events
Pull the actual logs from a specific search result. It is the way you see the raw data after running a query.

### get_field_values
See how often different values appear in a specific log field. This is great for understanding data distribution or finding common error types.

### list_fields
See all the different fields available in your current Loggly logs. This helps you know what you can actually filter by.

### list_users
See a list of everyone with access to your Loggly account. Use this to manage permissions and audit your team.

### search_events
Start a new search using Lucene syntax. This lets you find specific logs across your infrastructure without manual filtering.

### send_bulk_events
Send a large batch of line-separated logs to Loggly. This is the best way to move a lot of data at once.

### send_event
Send a single log entry or a JSON object to Loggly. It is perfect for real-time debugging and tracking specific actions.

## Prompt Examples

**Prompt:** 
```
Find all logs containing 'error' from the last 30 minutes.
```

**Response:** 
```
I've searched for 'error' in the last 30 minutes. Here is the summary of the results:

| Result Set ID | Error Count | Status |
| :--- | :--- | :--- |
| `rs_98723` | 42 | Active |

Would you like me to fetch the specific events for this result set?
```

**Prompt:** 
```
Send a JSON log for a successful user login.
```

**Response:** 
```
I've sent the following log event to Loggly:

```json
{
  "event": "user_login",
  "status": "success",
  "user_id": "u_5521",
  "timestamp": "2024-05-20T14:22:01Z"
}
```
The event was successfully indexed.
```

**Prompt:** 
```
Who has admin access to our Loggly account?
```

**Response:** 
```
I've checked the active users for your Loggly organization. Here are the users with administrative roles:

*   **admin_root** (Administrator)
*   **ops_lead_01** (Administrator)

All other users have 'Read-Only' or 'User' permissions.
```

## Capabilities

### Send log events
Push single or bulk logs to Loggly for real-time indexing.

### Run Lucene searches
Execute complex queries to filter through millions of events.

### Fetch search results
Retrieve paginated logs for deep analysis of system behavior.

### Analyze log fields
Get value counts and distributions to spot common errors.

### Manage account details
Check subscription limits and customer information.

### Audit active users
See who has access to your Loggly organization and what roles they have.

## Use Cases

### Production Outage Investigation
An SRE asks the agent to find all 500 errors in the last 10 minutes using search_events to identify the failing service.

### Debugging a New API Endpoint
A developer sends a JSON log via send_event to verify that a new endpoint is reachable and returning the correct status.

### Security Access Audit
A security lead uses list_users to check who has admin access to the logging platform and ensures only authorized staff are on the list.

### Traffic Distribution Analysis
A data engineer uses get_field_values to see which geographic regions are generating the most traffic based on log metadata.

## Benefits

- Stop tab-switching by using search_events to find errors directly in your chat app.
- Get a bird's eye view of your data with get_field_values to see common failure patterns.
- Speed up debugging by using send_event to push JSON logs from your code to the cloud.
- Manage your team permissions easily with list_users to keep your account secure.
- Handle high-volume data more efficiently using send_bulk_events for large log batches.

## How It Works

The bottom line is you get a conversational interface for your entire cloud logging infrastructure.

1. Subscribe to the Loggly MCP on Vinkius.
2. Input your Loggly Subdomain, API Token, and Customer Token.
3. Ask your agent to search for errors or send logs.

## Frequently Asked Questions

**Can I use Loggly MCP to find errors in my production logs?**
Yes. You can ask your agent to search for specific error codes or patterns using natural language. It will run the query and show you the relevant logs directly in your chat.

**How does Loggly MCP help with SRE tasks?**
It allows SREs to monitor infrastructure and troubleshoot issues faster. You can check for latency spikes, find specific service errors, and analyze log trends without leaving your AI client.

**Can I send logs to Loggly using my AI agent?**
Yes. You can ask your agent to send single JSON events or bulk batches of logs. This is great for real-time debugging and verifying that your application is sending the right data.

**Does Loggly MCP support Lucene search?**
Yes. The Connector is designed to execute Lucene queries. You can ask your agent to write the query for you based on your description of what you are looking for.

**How do I manage my Loggly users with this Connector?**
You can ask your agent to list all active users and their roles. This makes it easy to audit your permissions and see who has access to your logging platform.

**Can I use Loggly MCP for security auditing?**
Yes. You can use it to search for suspicious patterns, audit user roles, and check account details to ensure your logging infrastructure remains secure.

**How do I search for logs and see the results?**
Searching is a two-step process: first, use `search_events` with your Lucene query to get a Result Set ID (rsid). Then, use `get_events` with that rsid to retrieve the actual log data.

**Can I send JSON logs directly from the AI?**
Yes! Use the `send_event` tool and set `is_json` to true. You can pass a JSON string in the `event_data` field, and Loggly will parse it as a structured object.

**How can I see which fields are most common in my logs?**
You can use `list_fields` to see all available fields, or use `get_field_values` with a specific field name to get a count of the top values (faceting) for that field.