XML parsing error nil:NilClass [2020-04-22T16:13:54,199][ERROR][logstash.filters.ruby ][main] Ruby exception occurred: undefined method

Hi I am getting this error while parsing XML data using logstash

[2020-04-22T16:13:54,092][ERROR][logstash.filters.ruby ][main] Ruby exception occurred: undefined method []' for nil:NilClass [2020-04-22T16:13:54,199][ERROR][logstash.filters.ruby ][main] Ruby exception occurred: undefined method each_index' for {"p"=>"1", "content"=>"0"}:Hash

My data

		<granPeriod duration="PT300S" endTime="2020-03-22T00:05:00+00:00" />
		<measType p="1">VS.PDFENoAfSessModReqFail</measType>
		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_2_Host_0_Pool_0, Component=pdfe-stdn_imsgroup0-000">
			<r p="1">0</r>
		</measValue>
		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_2_Host_0_Pool_1, Component=pdfe-stdn_imsgroup0-001">
			<r p="1">0</r>
		</measValue>
		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_2_Host_0_Pool_2, Component=pdfe-stdn_imsgroup0-002">
			<r p="1">0</r>
		</measValue>
		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_2_Host_0_Pool_3, Component=pdfe-stdn_imsgroup0-003">
			<r p="1">0</r>
		</measValue>
		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_3_Host_0_Pool_4, Component=pdfe-stdn_imsgroup0-004">
			<r p="1">0</r>
		</measValue>
		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_3_Host_0_Pool_5, Component=pdfe-stdn_imsgroup0-005">
			<r p="1">0</r>
		</measValue>
		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_3_Host_0_Pool_6, Component=pdfe-stdn_imsgroup0-006">
			<r p="1">0</r>
		</measValue>
		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_3_Host_0_Pool_7, Component=pdfe-stdn_imsgroup0-007">
			<r p="1">0</r>
		</measValue>
		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_4_Host_0_Pool_8, Component=pdfe-stdn_imsgroup0-008">
			<r p="1">0</r>
		</measValue>
		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_4_Host_0_Pool_9, Component=pdfe-stdn_imsgroup0-009">
			<r p="1">0</r>
		</measValue>
		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_4_Host_0_Pool_10, Component=pdfe-stdn_imsgroup0-010">
			<r p="1">0</r>
		</measValue>
		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_4_Host_0_Pool_11, Component=pdfe-stdn_imsgroup0-011">
			<r p="1">0</r>
		</measValue>
	</measInfo>

My conf file

ruby {
	code => '
		xml = event.get("[@metadata][theXML]")
		types = xml["measType"]
		values = xml["measValue"]
		a = []
		values.each { |x|
			h = {}
			h["measObjLdn"] = x["measObjLdn"]
			x["r"].each_index { |i|
				h[types[i]["content"]] = x["r"][i]["content"]
			}
			a << h
		}
			event.set("data", a)
		'
}

it works when i have multiple rows in

<measType p="1">VS.PDFENoAfSessModReqFail</measType>

something wrong with ruby , i am not good in ruby , can someone help me.

If you have

        <r p="1">0</r>
        <r p="2">0</r>

then you will get

                "measObjLdn" => "Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_2_Host_0_Pool_0, Component=pdfe-stdn_imsgroup0-000",
                         "r" => [
                    [0] {
                              "p" => "1",
                        "content" => "0"
                    },
                    [1] {
                              "p" => "2",
                        "content" => "0"
                    }
                ]
            },

That is, r is an array. However, if you have

    <measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_2_Host_0_Pool_1, Component=pdfe-stdn_imsgroup0-001">
        <r p="1">0</r>
    </measValue>

then you will get

                "measObjLdn" => "Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_2_Host_0_Pool_1, Component=pdfe-stdn_imsgroup0-001",
                         "r" => {
                          "p" => "1",
                    "content" => "0"
                }
            },

where r is a hash rather than an array. A hash does not have an each_index method.

You could set force_array to true, and then both cases would result in an array.

It doesnt work

input {
    file {
        path =>"\A20200322.0000+0000-0005+0000_SubNetwork=as1bc,ManagedElement=ces-1"
		codec => multiline { pattern => "</measInfo>" negate => true what => next max_lines => 1000000 auto_flush_interval => 1 }
        start_position => "beginning"
        type => "xml"
    }
}

filter {
	mutate {
		 gsub => [ "message", "[<]measCollecFile[^>]*[>]", "" ]
	     gsub => [ "message", "^[^_]*<measData(.)$", "" ]
         gsub => [ "message", "[<]managedElement[^>]*[>]", "" ]
		 gsub => [ "message", "[^_]\/measData[^_]*$", "" ]
		 } 
    xml { source => "message" target => "[@metadata][theXML]" force_array => true
		}
	ruby {
		code => '
			xml = event.get("[@metadata][theXML]")
			types = xml["measType"]
			values = xml["measValue"]
			period = xml["granPeriod"]
			a = []
			values.each { |x|
				h = {}
				h["measObjLdn"] = x["measObjLdn"]
				h["timestamp"] = period["endTime"]
				x["r"].each_index { |i|
					h[types[i]["content"]] = x["r"][i]["content"]
				}
				a << h
			}
				event.set("data", a)
			'
	}
}


output {
#    elasticsearch {
#        hosts => ["127.0.0.1:9200"]
#        index => "t4"
#        document_type => "test"
#        user => "elastic"
#        password => "root123"
#    }
    stdout { codec=>rubydebug }
}

My file

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="MeasDataCollection.xsl"?>
<measCollecFile
	xmlns="http://www.3gpp.org/ftp/specs/latest/rel-5/32_series/32401-540.zip#measCollec">
	<fileHeader fileFormatVersion="32.401 V5.0"
		vendorName="Nokia"
		dnPrefix="">
		<fileSender
			localDn="SubNetwork=as1bc,ManagedElement=ces-1"
			elementType="GmscServer,Vlr" />
		<measCollec beginTime="2020-03-22T00:00:00+00:00" />
	</fileHeader>
	<measData>
		<managedElement
			localDn="SubNetwork=as1bc,ManagedElement=ces-1"
			userLabel=""
			vcpVersion="VM5.82.00"
			swVersion="R36.28.06.0100" />
		<measInfo>
			<granPeriod duration="PT300S" endTime="2020-03-22T00:05:00+00:00" />
			<measType p="1">VS.ADNSCacheHit</measType>
			<measType p="2">VS.ADNSCacheMiss</measType>
			<measType p="3">VS.ADNSDupeQuerySuppress</measType>
			<measType p="4">VS.ADNSCacheTTLExtended</measType>
			<measType p="5">VS.DNSQuerySent</measType>
			<measType p="6">VS.DNSQueryResponse</measType>
			<measValue measObjLdn="Service=h248, ServiceMember=Cabinet_0_Shelf_0_Card_4_Host_0_Pool_0">
				<r p="1">0</r>
				<r p="2">0</r>
				<r p="3">0</r>
				<r p="4">0</r>
				<r p="5">0</r>
				<r p="6">0</r>
			</measValue>
			<measValue measObjLdn="Service=h248, ServiceMember=Cabinet_0_Shelf_1_Card_4_Host_0_Pool_0">
				<r p="1">0</r>
				<r p="2">0</r>
				<r p="3">0</r>
				<r p="4">0</r>
				<r p="5">0</r>
				<r p="6">0</r>
			</measValue>
			<measValue measObjLdn="Service=h248, ServiceMember=Cabinet_0_Shelf_0_Card_4_Host_0_Pool_1">
				<r p="1">0</r>
				<r p="2">0</r>
				<r p="3">0</r>
				<r p="4">0</r>
				<r p="5">0</r>
				<r p="6">0</r>
			</measValue>
			<measValue measObjLdn="Service=h248, ServiceMember=Cabinet_0_Shelf_1_Card_4_Host_0_Pool_1">
				<r p="1">0</r>
				<r p="2">0</r>
				<r p="3">0</r>
				<r p="4">0</r>
				<r p="5">0</r>
				<r p="6">0</r>
			</measValue>
			<measValue measObjLdn="Service=h248, ServiceMember=Cabinet_0_Shelf_0_Card_5_Host_0_Pool_2">
				<r p="1">0</r>
				<r p="2">0</r>
				<r p="3">0</r>
				<r p="4">0</r>
				<r p="5">0</r>
				<r p="6">0</r>
			</measValue>
			<measValue measObjLdn="Service=h248, ServiceMember=Cabinet_0_Shelf_1_Card_5_Host_0_Pool_2">
				<r p="1">0</r>
				<r p="2">0</r>
				<r p="3">0</r>
				<r p="4">0</r>
				<r p="5">0</r>
				<r p="6">0</r>
			</measValue>
			<measValue measObjLdn="Service=h248, ServiceMember=Cabinet_0_Shelf_0_Card_5_Host_0_Pool_3">
				<r p="1">0</r>
				<r p="2">0</r>
				<r p="3">0</r>
				<r p="4">0</r>
				<r p="5">0</r>
				<r p="6">0</r>
			</measValue>
			<measValue measObjLdn="Service=h248, ServiceMember=Cabinet_0_Shelf_1_Card_5_Host_0_Pool_3">
				<r p="1">0</r>
				<r p="2">0</r>
				<r p="3">0</r>
				<r p="4">0</r>
				<r p="5">0</r>
				<r p="6">0</r>
			</measValue>
		</measInfo>
		<measInfo>
			<granPeriod duration="PT300S" endTime="2020-03-22T00:05:00+00:00" />
			<measType p="1">VS.aveCpuUsage</measType>
			<measType p="2">VS.peakCpuUsage</measType>
			<measValue measObjLdn="Cabinet=0, Shelf=0, Card=4, Host=0">
				<r p="1">1.21</r>
				<r p="2">2.38</r>
			</measValue>
			<measValue measObjLdn="Cabinet=0, Shelf=1, Card=4, Host=0">
				<r p="1">1.46</r>
				<r p="2">2.42</r>
			</measValue>
			<measValue measObjLdn="Cabinet=0, Shelf=0, Card=5, Host=0">
				<r p="1">1.14</r>
				<r p="2">1.88</r>
			</measValue>
			<measValue measObjLdn="Cabinet=0, Shelf=1, Card=5, Host=0">
				<r p="1">1.17</r>
				<r p="2">2.06</r>
			</measValue>
		</measInfo>
	</measData>
	<fileFooter>
		<measCollec endTime="2020-03-22T00:05:00+00:00" />
	</fileFooter>
</measCollecFile>

Output

[2020-04-28T19:12:25,311][INFO ][logstash.javapipeline    ][main] Pipeline started {"pipeline.id"=>"main"}
[2020-04-28T19:12:25,454][INFO ][filewatch.observingtail  ][main] START, creating Discoverer, Watch with file and sincedb collections
[2020-04-28T19:12:25,469][INFO ][logstash.agent           ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2020-04-28T19:12:26,515][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600}
[2020-04-28T19:12:28,566][ERROR][logstash.filters.ruby    ][main] Ruby exception occurred: undefined method `[]' for nil:NilClass
[2020-04-28T19:12:29,537][ERROR][logstash.filters.ruby    ][main] Ruby exception occurred: no implicit conversion of String into Integer
C:/Users/oza500/Desktop/elaticlife/logstash-7.6.1/vendor/bundle/jruby/2.5.0/gems/awesome_print-1.7.0/lib/awesome_print/formatters/base_formatter.rb:31: warning: constant ::Fixnum is deprecated
{
      "@version" => "1",
          "type" => "xml",
       "message" => "\t",
          "path" => "A20200322.0000+0000-0005+0000_SubNetwork=as1bc,ManagedElement=ces-1",
          "host" => "DESKTOP-AJVSOQJ",
          "tags" => [
        [0] "multiline",
        [1] "_rubyexception"
    ],
    "@timestamp" => 2020-04-28T17:12:28.147Z
}
{
      "@version" => "1",
          "type" => "xml",
       "message" => "\t\t<measInfo>\n\t\t\t<granPeriod duration=\"PT300S\" endTime=\"2020-03-22T00:05:00+00:00\" />\n\t\t\t<measType p=\"1\">VS.aveCpuUsage</measType>\n\t\t\t<measType p=\"2\">VS.peakCpuUsage</measType>\n\t\t\t<measValue measObjLdn=\"Cabinet=0, Shelf=0, Card=4, Host=0\">\n\t\t\t\t<r p=\"1\">1.21</r>\n\t\t\t\t<r p=\"2\">2.38</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Cabinet=0, Shelf=1, Card=4, Host=0\">\n\t\t\t\t<r p=\"1\">1.46</r>\n\t\t\t\t<r p=\"2\">2.42</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Cabinet=0, Shelf=0, Card=5, Host=0\">\n\t\t\t\t<r p=\"1\">1.14</r>\n\t\t\t\t<r p=\"2\">1.88</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Cabinet=0, Shelf=1, Card=5, Host=0\">\n\t\t\t\t<r p=\"1\">1.17</r>\n\t\t\t\t<r p=\"2\">2.06</r>\n\t\t\t</measValue>\n\t\t</measInfo>",
          "path" => "A20200322.0000+0000-0005+0000_SubNetwork=as1bc,ManagedElement=ces-1",
          "host" => "DESKTOP-AJVSOQJ",
          "tags" => [
        [0] "multiline",
        [1] "_rubyexception"
    ],
    "@timestamp" => 2020-04-28T17:12:26.985Z
}
[2020-04-28T19:12:29,790][ERROR][logstash.filters.ruby    ][main] Ruby exception occurred: no implicit conversion of String into Integer
[2020-04-28T19:12:29,821][ERROR][logstash.filters.ruby    ][main] Ruby exception occurred: no implicit conversion of String into Integer
{
      "@version" => "1",
          "type" => "xml",
       "message" => "\n\t\t\n\t\t<measInfo>\n\t\t\t<granPeriod duration=\"PT300S\" endTime=\"2020-03-22T00:05:00+00:00\" />\n\t\t\t<measType p=\"1\">VS.PDFENoAfSessModReqFail</measType>\n\t\t\t<measValue measObjLdn=\"Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_2_Host_0_Pool_0, Component=pdfe-stdn_imsgroup0-000\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_2_Host_0_Pool_1, Component=pdfe-stdn_imsgroup0-001\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_2_Host_0_Pool_2, Component=pdfe-stdn_imsgroup0-002\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_2_Host_0_Pool_3, Component=pdfe-stdn_imsgroup0-003\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_3_Host_0_Pool_4, Component=pdfe-stdn_imsgroup0-004\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_3_Host_0_Pool_5, Component=pdfe-stdn_imsgroup0-005\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_3_Host_0_Pool_6, Component=pdfe-stdn_imsgroup0-006\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_3_Host_0_Pool_7, Component=pdfe-stdn_imsgroup0-007\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_4_Host_0_Pool_8, Component=pdfe-stdn_imsgroup0-008\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_4_Host_0_Pool_9, Component=pdfe-stdn_imsgroup0-009\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_4_Host_0_Pool_10, Component=pdfe-stdn_imsgroup0-010\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_4_Host_0_Pool_11, Component=pdfe-stdn_imsgroup0-011\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t</measValue>\n\t\t</measInfo>",
          "path" => "A20200322.0000+0000-0005+0000_SubNetwork=as1bc,ManagedElement=ces-1",
          "host" => "DESKTOP-AJVSOQJ",
          "tags" => [
        [0] "multiline",
        [1] "_rubyexception"
    ],
    "@timestamp" => 2020-04-28T17:12:26.868Z
}
{
      "@version" => "1",
          "type" => "xml",
       "message" => "\t\t<measInfo>\n\t\t\t<granPeriod duration=\"PT300S\" endTime=\"2020-03-22T00:05:00+00:00\" />\n\t\t\t<measType p=\"1\">VS.ADNSCacheHit</measType>\n\t\t\t<measType p=\"2\">VS.ADNSCacheMiss</measType>\n\t\t\t<measType p=\"3\">VS.ADNSDupeQuerySuppress</measType>\n\t\t\t<measType p=\"4\">VS.ADNSCacheTTLExtended</measType>\n\t\t\t<measType p=\"5\">VS.DNSQuerySent</measType>\n\t\t\t<measType p=\"6\">VS.DNSQueryResponse</measType>\n\t\t\t<measValue measObjLdn=\"Service=h248, ServiceMember=Cabinet_0_Shelf_0_Card_4_Host_0_Pool_0\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t\t<r p=\"2\">0</r>\n\t\t\t\t<r p=\"3\">0</r>\n\t\t\t\t<r p=\"4\">0</r>\n\t\t\t\t<r p=\"5\">0</r>\n\t\t\t\t<r p=\"6\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=h248, ServiceMember=Cabinet_0_Shelf_1_Card_4_Host_0_Pool_0\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t\t<r p=\"2\">0</r>\n\t\t\t\t<r p=\"3\">0</r>\n\t\t\t\t<r p=\"4\">0</r>\n\t\t\t\t<r p=\"5\">0</r>\n\t\t\t\t<r p=\"6\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=h248, ServiceMember=Cabinet_0_Shelf_0_Card_4_Host_0_Pool_1\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t\t<r p=\"2\">0</r>\n\t\t\t\t<r p=\"3\">0</r>\n\t\t\t\t<r p=\"4\">0</r>\n\t\t\t\t<r p=\"5\">0</r>\n\t\t\t\t<r p=\"6\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=h248, ServiceMember=Cabinet_0_Shelf_1_Card_4_Host_0_Pool_1\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t\t<r p=\"2\">0</r>\n\t\t\t\t<r p=\"3\">0</r>\n\t\t\t\t<r p=\"4\">0</r>\n\t\t\t\t<r p=\"5\">0</r>\n\t\t\t\t<r p=\"6\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=h248, ServiceMember=Cabinet_0_Shelf_0_Card_5_Host_0_Pool_2\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t\t<r p=\"2\">0</r>\n\t\t\t\t<r p=\"3\">0</r>\n\t\t\t\t<r p=\"4\">0</r>\n\t\t\t\t<r p=\"5\">0</r>\n\t\t\t\t<r p=\"6\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=h248, ServiceMember=Cabinet_0_Shelf_1_Card_5_Host_0_Pool_2\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t\t<r p=\"2\">0</r>\n\t\t\t\t<r p=\"3\">0</r>\n\t\t\t\t<r p=\"4\">0</r>\n\t\t\t\t<r p=\"5\">0</r>\n\t\t\t\t<r p=\"6\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=h248, ServiceMember=Cabinet_0_Shelf_0_Card_5_Host_0_Pool_3\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t\t<r p=\"2\">0</r>\n\t\t\t\t<r p=\"3\">0</r>\n\t\t\t\t<r p=\"4\">0</r>\n\t\t\t\t<r p=\"5\">0</r>\n\t\t\t\t<r p=\"6\">0</r>\n\t\t\t</measValue>\n\t\t\t<measValue measObjLdn=\"Service=h248, ServiceMember=Cabinet_0_Shelf_1_Card_5_Host_0_Pool_3\">\n\t\t\t\t<r p=\"1\">0</r>\n\t\t\t\t<r p=\"2\">0</r>\n\t\t\t\t<r p=\"3\">0</r>\n\t\t\t\t<r p=\"4\">0</r>\n\t\t\t\t<r p=\"5\">0</r>\n\t\t\t\t<r p=\"6\">0</r>\n\t\t\t</measValue>\n\t\t</measInfo>",
          "path" => "A20200322.0000+0000-0005+0000_SubNetwork=as1bc,ManagedElement=ces-1",
          "host" => "DESKTOP-AJVSOQJ",
          "tags" => [
        [0] "multiline",
        [1] "_rubyexception"
    ],
    "@timestamp" => 2020-04-28T17:12:26.973Z

I have both type of data one where

		<measValue measObjLdn="Service=ims, ServiceMember=Cabinet_0_Shelf_1_Card_2_Host_0_Pool_0, Component=pdfe-stdn_imsgroup0-000">
			<r p="1">0</r>
		</measValue>

And


<measValue measObjLdn="Service=h248, ServiceMember=Cabinet_0_Shelf_0_Card_4_Host_0_Pool_0">
				<r p="1">0</r>
				<r p="2">0</r>
				<r p="3">0</r>
				<r p="4">0</r>
				<r p="5">0</r>
				<r p="6">0</r>
			</measValue>

Enable 'metadata => true' on the rubydebug output. Look at the changes that happen when you enable force_array. Adjust your ruby code appropriately.

Works fine Thank you so much.

Do you know the esaiset way to convert this timestamp

"2020-03-22T00:05:00+00:00\"

into ISO 8601.?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.