langchain_community.document_loaders.datadog_logs.DatadogLogsLoader¶
- class langchain_community.document_loaders.datadog_logs.DatadogLogsLoader(query: str, api_key: str, app_key: str, from_time: Optional[int] = None, to_time: Optional[int] = None, limit: int = 100)[source]¶
- 加载 Datadog 日志。 - 日志写入到 page_content 和 metadata 中。 - 初始化 Datadog 文档加载器。 - 要求
- 必须安装 datadog_api_client。使用 pip install datadog_api_client 安装。 
 
 - 参数
- query (str) – 在 Datadog 中运行的查询。 
- api_key (str) – Datadog API 密钥。 
- app_key (str) – Datadog 应用程序密钥。 
- from_time (Optional[int]) – 可选。查询的时间段的开始。支持日期数学和常规时间戳(毫秒)如 ‘1688732708951’ 默认为20分钟前。 
- to_time (Optional[int]) – 可选。查询的时间段的结束。支持日期数学和常规时间戳(毫秒)如 ‘1688732708951’ 默认为现在。 
- limit (int) – 返回的最大日志数。默认为100。 
 
 - 方法 - __init__(query, api_key, app_key[, ...])- 初始化 Datadog 文档加载器。 - Documents 的懒加载器。 - aload()- 将数据加载到 Document 对象中。 - Documents 的懒加载器。 - load()- 从 Datadog 获取日志。 - load_and_split([text_splitter])- 加载 Documents 并分割成块。 - parse_log(log)- 从 Datadog 日志项创建 Document 对象。 - __init__(query: str, api_key: str, app_key: str, from_time: Optional[int] = None, to_time: Optional[int] = None, limit: int = 100) None[来源]¶
- 初始化 Datadog 文档加载器。 - 要求
- 必须安装 datadog_api_client。使用 pip install datadog_api_client 安装。 
 
 - 参数
- query (str) – 在 Datadog 中运行的查询。 
- api_key (str) – Datadog API 密钥。 
- app_key (str) – Datadog 应用程序密钥。 
- from_time (Optional[int]) – 可选。查询的时间段的开始。支持日期数学和常规时间戳(毫秒)如 ‘1688732708951’ 默认为20分钟前。 
- to_time (Optional[int]) – 可选。查询的时间段的结束。支持日期数学和常规时间戳(毫秒)如 ‘1688732708951’ 默认为现在。 
- limit (int) – 返回的最大日志数。默认为100。 
 
- 返回类型
- None 
 
 - load() List[Document][source]¶
- 从 Datadog 获取日志。 - 返回值
- Document 对象的列表。
- 页面内容 
- 元数据
- id 
- 服务 
- 状态 
- 标签 
- 时间戳 
 
 
 
 
- 返回类型
- List[Document] 
 
 - load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document]¶
- 加载文档并将其拆分为块。块以 Document 的形式返回。 - 不要重写此方法。考虑将其弃用! - 参数
- text_splitter (可选[TextSplitter]) – 用于拆分文档的 TextSplitter 实例。默认为 RecursiveCharacterTextSplitter。 
- 返回值
- 文档列表。 
- 返回类型
- List[Document]