get_http_log_source
Retrieve detailed configuration of an HTTP log source by ID for troubleshooting and monitoring. Provides integration details, log types, authentication methods, and stream settings.
Instructions
Get detailed information about a specific HTTP log source by ID.
HTTP log sources are used to collect logs via HTTP endpoints/webhooks. This tool provides detailed configuration information for troubleshooting and monitoring HTTP log source integrations.
Args: source_id: The ID of the HTTP log source to retrieve
Returns: Dict containing: - success: Boolean indicating if the query was successful - source: HTTP log source information if successful, containing: - integrationId: The source ID - integrationLabel: The source name/label - logTypes: List of log types this source handles - logStreamType: Stream type (Auto, JSON, JsonArray, etc.) - logStreamTypeOptions: Additional stream type configuration - authMethod: Authentication method (None, Bearer, Basic, etc.) - authBearerToken: Bearer token if using Bearer auth - authUsername: Username if using Basic auth - authPassword: Password if using Basic auth - authHeaderKey: Header key for HMAC/SharedSecret auth - authSecretValue: Secret value for HMAC/SharedSecret auth - authHmacAlg: HMAC algorithm if using HMAC auth - message: Error message if unsuccessful
Permissions:{'all_of': ['View Log Sources']}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_id | Yes | The ID of the HTTP log source to fetch |
Implementation Reference
- The main handler function that fetches the HTTP log source details using the REST client. Handles success and error cases, returning formatted dict.async def get_http_log_source( source_id: Annotated[ str, Field( description="The ID of the HTTP log source to fetch", examples=["http-source-123", "webhook-collector-456"], ), ], ) -> dict[str, Any]: """Get detailed information about a specific HTTP log source by ID. HTTP log sources are used to collect logs via HTTP endpoints/webhooks. This tool provides detailed configuration information for troubleshooting and monitoring HTTP log source integrations. Args: source_id: The ID of the HTTP log source to retrieve Returns: Dict containing: - success: Boolean indicating if the query was successful - source: HTTP log source information if successful, containing: - integrationId: The source ID - integrationLabel: The source name/label - logTypes: List of log types this source handles - logStreamType: Stream type (Auto, JSON, JsonArray, etc.) - logStreamTypeOptions: Additional stream type configuration - authMethod: Authentication method (None, Bearer, Basic, etc.) - authBearerToken: Bearer token if using Bearer auth - authUsername: Username if using Basic auth - authPassword: Password if using Basic auth - authHeaderKey: Header key for HMAC/SharedSecret auth - authSecretValue: Secret value for HMAC/SharedSecret auth - authHmacAlg: HMAC algorithm if using HMAC auth - message: Error message if unsuccessful """ logger.info(f"Fetching HTTP log source: {source_id}") try: # Execute the REST API call async with get_rest_client() as client: response_data, status_code = await client.get( f"/log-sources/http/{source_id}" ) logger.info(f"Successfully retrieved HTTP log source: {source_id}") # Format the response return { "success": True, "source": response_data, } except Exception as e: logger.error(f"Failed to fetch HTTP log source: {str(e)}") return { "success": False, "message": f"Failed to fetch HTTP log source: {str(e)}", }
- src/mcp_panther/panther_mcp_core/tools/sources.py:137-142 (registration)Registers the get_http_log_source tool with MCP, specifying required permissions and read-only nature.@mcp_tool( annotations={ "permissions": all_perms(Permission.LOG_SOURCE_READ), "readOnlyHint": True, } )
- Pydantic-based input schema definition for the source_id parameter, including description and examples.source_id: Annotated[ str, Field( description="The ID of the HTTP log source to fetch", examples=["http-source-123", "webhook-collector-456"], ), ],