• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Receiving json-data over http-service

    Mango General
    2
    3
    2.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sasa
      last edited by

      Hi together,

      I need some help with this data:

      0_1470847376624_json-source.PNG

      That data comes from a software logger over http-service in json-fomat. I need the two parameters under "tuples": [(timestamp, value)]. Some suggestions? I was trying out some variants of data sources, but it didn´t worked.

      Regards
      Sasa

      1 Reply Last reply Reply Quote 0
      • terrypackerT
        terrypacker
        last edited by

        sasa,

        I would suggest using the HTTP Retriever data source and setting up data points with the appropriate regex patterns to extract the values for the points. Basically point the HTTP Retriever at the URL you need and then setup 2 Numeric points with regex setup to extract each of the values from "tuples".

        Here is some regex that sort of works for a simple test but you may need to tweak it a little:

        .*"tuples": [ \{ ([0-9]+), ([0-9]+).*}.*
        

        You can test your regex here or any of the many sites that allow testing regex patterns:
        http://regex-testdrive.com/

        1 Reply Last reply Reply Quote 0
        • S
          sasa
          last edited by

          Terry,

          thank you for your help. I used the type "HTTP Retriever" where it is possible to create points by choosing the groups of the matched regular expression (now I understand the functionallity ;-)). I had to change the expression a little bit. Here is the working implementation as example for others and documentation.

          Regular Expression

          .*"tuples": [ [ ([0-9]+), ([0-9]+\.[0-9]+).] ] \} ] \}
          

          Target string:

          { "version": "0.5.1", "generator": "vzlogger", "data": [ { "uuid": "123", "last": 1470924327196, "interval": 5, "protocol": "d0", "tuples": [ [ 1470924327195, 115.185 ] ] } ] }
          

          Matcher

          group(0)	{ "version": "0.5.1", "generator": "vzlogger", "data": [ { "uuid": "123", "last": 1470924327196, "interval": 5, "protocol": "d0", "tuples": [ [ 1470924327195, 115.185 ] ] } ] }
          
          group(1)	1470924327195
          
          group(2)	115.185
          

          Configuration in Mango for choosing the value group 2 (115.185)

          0_1470933096792_http-retriever-point.PNG
          .

          Value in the watchlist

          0_1470933232504_watchlist.PNG

          .

          Thank you very much!
          Sasa

          1 Reply Last reply Reply Quote 0
          • First post
            Last post