【问题标题】:dumping XML log files into Splunk将 XML 日志文件转储到 Splunk
【发布时间】:2014-07-23 12:44:43
【问题描述】:

我想在 Splunk 中转储以下 XML 日志文件,记住它应该将所有标签作为字段提供,这样我就可以搜索其中的事件

Text="Application: Directory started" Category="BIG" Module="WorkflowHost"

props.conf 中应该写什么

<Message>
  <ID>
    b476f836-36dd-4c30-9a8e-0587c5d34b8d-
  </ID>
  <Date>
    2014-01-09 10:45:31.69
  </Date>
  <Text>
    Application: Directory started
  </Text>
  <Category>
    BIG
  </Category>
  <Source>
    Workflow
  </Source>
  <Level>
    Event
  </Level>
  <Class>
    General
  </Class>
  <Module>
    WorkflowHost
  </Module>
  <LineNumber>
    0
  </LineNumber>
  <ProcessID>
    5420
  </ProcessID>
  <User>
    e2ac3262e9b9d03f
  </User>
</Message>


<Message>
  <ID>
    b476f836-36dd-4c30-9a8e-0587c5d34b8d
  </ID>
  <Date>
    2014-01-09 10:45:41.57
  </Date>
  <Text>
    Application: PatientDirectory started
  </Text>
  <Category>
    BIG
  </Category>
  <Source>
    PatientDirectory
  </Source>
  <Level>
    Event
  </Level>
  <Class>
    General
  </Class>
  <Module>
    PatientDirectory
  </Module>
  <LineNumber>
    0
  </LineNumber>
  <ProcessID>
    2180
  </ProcessID>
  <User>
    e2ac3262e9b9d03f
  </User>
</Message>

PL 帮助....:)

【问题讨论】:

    标签: xml xml-parsing splunk


    【解决方案1】:

    在您要索引的源类型的 props.conf 节中,添加

    KV_MODE=xml
    

    这将自动提取所有字段和值。

    您可以在此处的 props.conf 文件文档中找到更多详细信息:

    http://docs.splunk.com/Documentation/Splunk/latest/Admin/propsconf
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-04
      • 2021-11-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多