I am currently looking to parse some json records on logstash to then push to opensearch/kibana for analysis. Specifically I hope to pull the "rtt" and associated "instance" value metric from each message body so I can report on latency. Being a complete newbie to json parsing and logstash however I could do with some pointers from some experts.
Can anyone help me on how to build a json parser to pull the "rtt" metric json object along with its associated dimensions...."instance" && "session". Below is a sample JSON record that I am working with.
Any help/pointers/advice is greatly appreciated as Im a newbie running out of ideas.
[{"MetricName":"read_bytes_rate","Timestamp":"2021-10-25T14:06:23Z","Value":8.5159199999999999e-109,"Dimensions":[{"Name":"instance","Value":"i-123456"},{"Name":"session","Value":"1234234-1234-4ac2134c-12323-1234234"},{"Name":"connection","Value":"1"},{"Name":"channel","Value":"usb"}]},{"MetricName":"written_bytes","Timestamp":"2021-10-25T14:07:23Z","Value":56.0,"Dimensions":[{"Name":"instance","Value":"i-123456"},{"Name":"session","Value":"1234234-1234-4ac2134c-12323-1234234"},{"Name":"connection","Value":"1"},{"Name":"channel","Value":"usb"}]},{"MetricName":"connection_count","Timestamp":"2021-10-25T12:29:45Z","Value":1.0,"Dimensions":[{"Name":"instance","Value":"i-123456"},{"Name":"session","Value":"1234234-1234-4ac2134c-12323-1234234"}]},{"MetricName":"rtt","Timestamp":"2021-10-25T14:07:23Z","Unit":"Milliseconds","StatisticValues":{"SampleCount":23,"Sum":129.398,"Minimum":3.5150000000000001,"Maximum":16.617999999999999},"Dimensions":[{"Name":"instance","Value":"i-123456"},{"Name":"session","Value":"1234234-1234-4ac2134c-12323-1234234"},{"Name":"connection","Value":"1"},{"Name":"channel","Value":"main"}]},{"MetricName":"rtt_p50","Timestamp":"2021-10-25T14:07:23Z","Unit":"Milliseconds","Value":4.7679999999999998,"Dimensions":[{"Name":"instance","Value":"i-123456"},{"Name":"session","Value":"1234234-1234-4ac2134c-12323-1234234"},{"Name":"connection","Value":"1"},{"Name":"channel","Value":"main"}]},{"MetricName":"rtt_p90","Timestamp":"2021-10-25T14:07:23Z","Unit":"Milliseconds","Value":8.0126000000000008,"Dimensions":[{"Name":"instance","Value":"i-123456"},{"Name":"session","Value":"1234234-1234-4ac2134c-12323-1234234"},{"Name":"connection","Value":"1"},{"Name":"channel","Value":"main"}]},{"MetricName":"rtt_p99","Timestamp":"2021-10-25T14:07:23Z","Unit":"Milliseconds","Value":15.233100000000007,"Dimensions":[{"Name":"instance","Value":"i-123456"},{"Name":"session","Value":"1234234-1234-4ac2134c-12323-1234234"},{"Name":"connection","Value":"1"},{"Name":"channel","Value":"main"}]},{"MetricName":"session_count","Timestamp":"2021-10-25T12:29:44Z","Value":1.0,"Dimensions":[{"Name":"instance","Value":"i-123456"}]},{"MetricName":"written_bytes_rate","Timestamp":"2021-10-25T14:06:23Z","Value":8.5159199999999999e-109,"Dimensions":[{"Name":"instance","Value":"i-123456"},{"Name":"session","Value":"1234234-1234-4ac2134c-12323-1234234"},{"Name":"connection","Value":"1"},{"Name":"channel","Value":"PhotonMessageChannel"}]},{"MetricName":"written_bytes","Timestamp":"2021-10-25T14:07:23Z","Value":24.0,"Dimensions":[{"Name":"instance","Value":"i-123456"},{"Name":"session","Value":"1234234-1234-4ac2134c-12323-1234234"},{"Name":"connection","Value":"1"},{"Name":"channel","Value":"filestorage"}]},{"MetricName":"written_bytes","Timestamp":"2021-10-25T14:07:23Z","Value":1389840.0,"Dimensions":[{"Name":"instance","Value":"i-123456"},{"Name":"session","Value":"1234234-1234-4ac2134c-12323-1234234"},{"Name":"connection","Value":"1"},{"Name":"channel","Value":"input"}]},{"MetricName":"written_bytes","Timestamp":"2021-10-25T14:07:23Z","Value":660256.0,"Dimensions":[{"Name":"instance","Value":"i-123456"},{"Name":"session","Value":"1234234-1234-4ac2134c-12323-1234234"},{"Name":"connection","Value":"1"},{"Name":"channel","Value":"redirection"}]},{"MetricName":"written_bytes","Timestamp":"2021-10-25T14:07:23Z","Value":113194.0,"Dimensions":[{"Name":"instance","Value":"i-123456"},{"Name":"session","Value":"1234234-1234-4ac2134c-12323-1234234"},{"Name":"connection","Value":"1"},{"Name":"channel","Value":"clipboard"}]}]