Closed sjwang90 closed 2 years ago
Oh and update the sample output with this:
> citibike,station_id=3771 is_installed=1,is_renting=1,is_returning=1,num_bikes_available=29,num_bikes_disabled=1,num_docks_available=0,num_docks_disabled=0,num_ebikes_available=0 1597346896000000000
> citibike,station_id=3772 is_installed=1,is_renting=1,is_returning=1,num_bikes_available=8,num_bikes_disabled=0,num_docks_available=11,num_docks_disabled=0,num_ebikes_available=3 1597345539000000000
> citibike,station_id=3773 is_installed=1,is_renting=1,is_returning=1,num_bikes_available=18,num_bikes_disabled=1,num_docks_available=1,num_docks_disabled=0,num_ebikes_available=0 1597346389000000000
> citibike,station_id=3774 is_installed=1,is_renting=1,is_returning=1,num_bikes_available=20,num_bikes_disabled=0,num_docks_available=3,num_docks_disabled=0,num_ebikes_available=0 1597346929000000000
to prevent the link from changing again or the format from changing I would suggest pointing the link to a free github pages website that is hardcoded to return the appropriate JSON.
I tested @sjwang90 's config and it worked as expected :)
Also I just realized instead of a github pages website I can do a even easier method: github gist
If the gist ever gets deleted a partial JSON blob (not all is needed) is below:
{
"data": {
"stations": [
{
"is_renting": 1,
"num_bikes_disabled": 1,
"is_installed": 1,
"num_bikes_available": 10,
"legacy_id": "72",
"is_returning": 1,
"eightd_has_available_keys": false,
"num_ebikes_available": 2,
"station_id": "72",
"last_reported": 1604455485,
"num_docks_disabled": 0,
"num_docks_available": 44,
"station_status": "active"
},
{
"is_renting": 1,
"num_bikes_disabled": 2,
"is_installed": 1,
"num_bikes_available": 25,
"legacy_id": "79",
"is_returning": 1,
"eightd_has_available_keys": false,
"num_ebikes_available": 0,
"station_id": "79",
"last_reported": 1604455168,
"num_docks_disabled": 0,
"num_docks_available": 6,
"station_status": "active"
},
{
"is_renting": 1,
"num_bikes_disabled": 1,
"is_installed": 1,
"num_bikes_available": 17,
"legacy_id": "82",
"is_returning": 1,
"eightd_has_available_keys": false,
"num_ebikes_available": 0,
"station_id": "82",
"last_reported": 1604456065,
"num_docks_disabled": 0,
"num_docks_available": 9,
"station_status": "active"
},
{
"is_renting": 1,
"num_bikes_disabled": 0,
"is_installed": 1,
"num_bikes_available": 43,
"legacy_id": "83",
"is_returning": 1,
"eightd_has_available_keys": false,
"num_ebikes_available": 1,
"station_id": "83",
"last_reported": 1604454968,
"num_docks_disabled": 0,
"num_docks_available": 19,
"station_status": "active"
},
{
"is_renting": 0,
"num_bikes_disabled": 0,
"is_installed": 0,
"num_bikes_available": 0,
"legacy_id": "116",
"is_returning": 0,
"eightd_has_available_keys": false,
"num_ebikes_available": 0,
"station_id": "116",
"last_reported": 86400,
"num_docks_disabled": 0,
"num_docks_available": 0,
"station_status": "out_of_service"
},
{
"is_renting": 1,
"num_bikes_disabled": 1,
"is_installed": 1,
"num_bikes_available": 43,
"legacy_id": "119",
"is_returning": 1,
"eightd_has_available_keys": false,
"num_ebikes_available": 1,
"station_id": "119",
"last_reported": 1604455328,
"num_docks_disabled": 0,
"num_docks_available": 9,
"station_status": "active"
},
{
"is_renting": 1,
"num_bikes_disabled": 1,
"is_installed": 1,
"num_bikes_available": 2,
"legacy_id": "120",
"is_returning": 1,
"eightd_has_available_keys": false,
"num_ebikes_available": 2,
"station_id": "120",
"last_reported": 1604456296,
"num_docks_disabled": 0,
"num_docks_available": 16,
"station_status": "active"
},
{
"is_renting": 1,
"num_bikes_disabled": 2,
"is_installed": 1,
"num_bikes_available": 29,
"legacy_id": "127",
"is_returning": 1,
"eightd_has_available_keys": false,
"num_ebikes_available": 0,
"station_id": "127",
"last_reported": 1604456402,
"num_docks_disabled": 0,
"num_docks_available": 0,
"station_status": "active"
},
{
"is_renting": 1,
"num_bikes_disabled": 1,
"is_installed": 1,
"num_bikes_available": 48,
"legacy_id": "128",
"is_returning": 1,
"eightd_has_available_keys": false,
"num_ebikes_available": 2,
"station_id": "128",
"last_reported": 1604456459,
"num_docks_disabled": 0,
"num_docks_available": 7,
"station_status": "active"
},
{
"is_renting": 1,
"num_bikes_disabled": 0,
"is_installed": 1,
"num_bikes_available": 10,
"legacy_id": "143",
"is_returning": 1,
"eightd_has_available_keys": false,
"num_ebikes_available": 1,
"station_id": "143",
"last_reported": 1604455187,
"num_docks_disabled": 0,
"num_docks_available": 14,
"station_status": "active"
}
]
},
"last_updated": 1604456515,
"ttl": 5
}
Update this... https://v2.docs.influxdata.com/v2.0/write-data/no-code/use-telegraf/use-telegraf-plugins/use-http-plugin/#example-configuration
with this...
...to address broken link