wzxmt_l  
                (wzxmt l)
               
                 
              
                  
                    August 6, 2019,  3:08am
                   
                   
              1 
               
             
            
              Hi All,Here is my xml,I want to parse this xml, how can I parse it?
<?xml version="1.0" encoding="UTF-8"?>
<holding_stock msgnum="3480"> 
<user_id>10028603</user_id> 
******** 
<pos_str>0</pos_str> 
<request_num>1000</request_num> 
0 
</holding_stock>
             
            
               
               
               
            
            
           
          
            
              
                Badger  
                
               
              
                  
                    August 6, 2019, 12:31pm
                   
                   
              2 
               
             
            
              If you ingest that as a single event then you can parse it using an xml filter
xml { source => "message" target => "theXML" }
 
results in
    "theXML" => {
         "msgnum" => "3480",
        "content" => [
        [0] "\n",
        [1] "\n********\n",
        [2] "\n",
        [3] "\n0\n"
    ],
        "user_id" => [
        [0] "10028603"
    ],
        "pos_str" => [
        [0] "0"
    ],
    "request_num" => [
        [0] "1000"
    ]
}, 
             
            
               
               
               
            
            
           
          
            
              
                wzxmt_l  
                (wzxmt l)
               
              
                  
                    August 7, 2019,  1:29am
                   
                   
              3 
               
             
            
              Thank you, add xpath to parse out what I want!
             
            
               
               
               
            
            
           
          
            
              
                system  
                (system)
                  Closed 
               
              
                  
                    September 4, 2019,  1:29am
                   
                   
              4 
               
             
            
              This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.