Getting Data In

Index specific tag from XML

michaelrosello
Path Finder

I'm trying to index only a few fields from my XML Data but I cannot make it work using props and transform

Here is my sample xml data.

<ase:aseXML xmlns:ase="urn:aseXML:r36" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:aseXML:r36 http://www.nemmco.com.au/asexml/schemas/r36/aseXML_r36.xsd">;
   <Header>
      <From>EEE</From>
      <To>EEQ</To>
      <MessageID>-MSG-62350571</MessageID>
      <MessageDate>2018-05-28T11:48:58.865+10:00</MessageDate>
      <TransactionGroup>OWNX</TransactionGroup>
      <Priority>Medium</Priority>
      <SecurityContext>EGG</SecurityContext>
      <Market>NEM</Market>
   </Header>
   <Transactions>
      <Transaction transactionDate="2018-05-28T11:48:52.029+10:00" transactionID="ERGONETP-TNS-222754923">
         <MeterFaultAndIssueNotification version="r36">
            <NMI checksum="4">3053066985</NMI>
            <DateIdentified>2018-05-28</DateIdentified>
            <SupplyOn>Yes</SupplyOn>
            <ReasonForNotice>Other</ReasonForNotice>
            <Notes>NOTES.</Notes>
         </MeterFaultAndIssueNotification>
      </Transaction>
   </Transactions>
</ase:aseXML>

I only need to index this fields

     <MessageID>-MSG-62350571</MessageID>
           <MessageDate>2018-05-28T11:48:58.865+10:00</MessageDate>
           <TransactionGroup>OWNX</TransactionGroup>

and here is my props and transform

props.conf
[msatt]
NO_BINARY_CHECK = true
category = Custom
pulldown_type = 1
TRUNCATE = 0
disabled = false
MAX_EVENTS = 5000
TRANSFORMS-set-nullqueue=set_index,set_nullqueue

transforms.conf

[set_nullqueue]
REGEX=.
DEST_KEY=queue
FORMAT=nullQueue

[set_index]
REGEX = <MessageID>(?<MessageID>.*)<\/MessageID>\s+<MessageDate>(?<MessageDate>.*)<\/MessageDate>\s+<TransactionGroup>(?<TransactionGroup>.*)\/TransactionGroup>
DEST_KEY = queue
FORMAT = indexQueue
0 Karma

niketn
Legend

@michaelrosello, from the sample XML data, which nodes you want to drop and what do you need to retain?

Do you want to index only transactions i.e. <Transactions>....</Transactions>?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

michaelrosello
Path Finder

ohhh. sorry forgot to add what i want to index.

I want to index only this three values.

-MSG-62350571
2018-05-28T11:48:58.865+10:00OWNX

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...