XML field array question


(Shubhangi Gaikwad) #1

XML Source:

"@version": "1",
"@timestamp": "2015-06-08T11:10:30.296Z",
"host": "localhost",
"path": "/mnt/xmlpath/new13.xml",
"tags": [
"multiline"
],
"response": {
"statusCode": [
"200"
],
"statusText": [
"Ok"
],
"requestId": [
"1"
],
"data": [
{
"testId": [
"150603_VD_9VJ"
],
"successfulRVRuns": [
"1"
],
"run": [
{
"id": [
"1"
],
"firstView": [
{
"tester": [
"IE9103-192.168.101.93
"
],
"videoFrames": [
{
"frame": [
{
"time": [
"0"
],
"image": [
"http://www.webpagetest.org/getfile.php?test=150603_VD_9VJ&video=video_1&file=frame_0000.jpg"
],
"VisuallyComplete": [
"0"
]
},
{
"time": [
"800"
],
"image": [
"http://www.webpagetest.org/getfile.php?test=150603_VD_9VJ&video=video_1&file=frame_0008.jpg"
],
"VisuallyComplete": [
"49"
]
},
{
"time": [
"1600"
],
"image": [
"http://www.webpagetest.org/getfile.php?test=150603_VD_9VJ&video=video_1&file=frame_0016.jpg"
],
"VisuallyComplete": [
"58"
]
},
{
"time": [
"1800"
],
"image": [
"http://www.webpagetest.org/getfile.php?test=150603_VD_9VJ&video=video_1&file=frame_0018.jpg"
],
"VisuallyComplete": [
"89"
]
},
{
"time": [
"5600"
],
"image": [
"http://www.webpagetest.org/getfile.php?test=150603_VD_9VJ&video=video_1&file=frame_0056.jpg"
],
"VisuallyComplete": [
"99"
]
},
{
"time": [
"6400"
],
"image": [
"http://www.webpagetest.org/getfile.php?test=150603_VD_9VJ&video=video_1&file=frame_0064.jpg"
],
"VisuallyComplete": [
"100"
]
},
]
}
]
}
],

          "repeatView": [
            {
              "tester": [
                "IE9103-192.168.101.93<br>"
              ],
              "videoFrames": [
                {
                  "frame": [
                    {
                      "time": [
                        "0"
                      ],
                      "image": [
                        "http://www.webpagetest.org/getfile.php?test=150603_VD_9VJ&video=video_1_cached&file=frame_0000.jpg"
                      ],
                      "VisuallyComplete": [
                        "0"
                      ]
                    },
                    {
                      "time": [
                        "500"
                      ],
                      "image": [
                        "http://www.webpagetest.org/getfile.php?test=150603_VD_9VJ&video=video_1_cached&file=frame_0005.jpg"
                      ],
                      "VisuallyComplete": [
                        "44"
                      ]
                    },
                    {
                      "time": [
                        "1100"
                      ],
                      "image": [
                        "http://www.webpagetest.org/getfile.php?test=150603_VD_9VJ&video=video_1_cached&file=frame_0011.jpg"
                      ],
                      "VisuallyComplete": [
                        "52"
                      ]
                    },
                    {
                      "time": [
                        "1800"
                      ],
                      "image": [
                        "http://www.webpagetest.org/getfile.php?test=150603_VD_9VJ&video=video_1_cached&file=frame_0018.jpg"
                      ],
                      "VisuallyComplete": [
                        "90"
                      ]
                    },
                    {
                      "time": [
                        "2000"
                      ],
                      "image": [
                        "http://www.webpagetest.org/getfile.php?test=150603_VD_9VJ&video=video_1_cached&file=frame_0020.jpg"
                      ],
                      "VisuallyComplete": [
                        "90"
                      ]
                    },
                    {
                      "time": [
                        "2500"
                      ],
                      "image": [
                        "http://www.webpagetest.org/getfile.php?test=150603_VD_9VJ&video=video_1_cached&file=frame_0025.jpg"
                      ],
                      "VisuallyComplete": [

...

config:

mutate {add_field => {
"time_fv" => "%{[response][data][run][firtsView][videoFrames][0][frame][0][time][0]}"
}
}
mutate {convert => ["time_fv", "float"]}
}

Expecting output:
"time_fv" should hold all values.

How would i config logstash so that added field holds all value coming under <?time> ...<?time> for both <?firstView>& <?repeatView>

Any help or suggestions


(Shubhangi Gaikwad) #2

Any help in this regard would be great???


(Shubhangi Gaikwad) #3

Can we do it through logstash


(system) #4