cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

get_network_devices(network_id) JSON transformation

SOLVED
Here to help

get_network_devices(network_id) JSON transformation

Output generated from  get_network_devices(network_id) API is below need to transform it to other format 

{
"address": "",
"firmware": "switch-11-22",
"floorPlanId": null,
"lanIp": "192.168.128.42",
"lat": 37.4180951010362,
"lng": -122.098531723022,
"model": "MS220-8P",
"name": "Office Switch",
"switchProfileId": null
}

 

need to transform it into mapping for geo plotting in kibana 

 

{
   "mappings": {
      "_doc": {
         "properties": {
            "location": {
               "type": "geo_point"
            }
         }
      }
   }
}

 

1 ACCEPTED SOLUTION

Accepted Solutions
Here to help

Re: get_network_devices(network_id) JSON transformation

for kibana the mapping information have to be in the formate below 

{
   "mappings": {
      "_doc": {
         "properties": {
            "location": {
               "type": "geo_point"
            }
         }
      }
   }
}

and sample data look like this

{"index":{"_id":1}}
{"location": "2.089330000000046,41.47367000000008", "city": "SantCugat"}
{"index":{"_id":2}}
{"location": "2.2947825000000677,41.601800991000076", "city": "Granollers"}
{"index":{"_id":3}}
{"location": "2.1105957495300474,41.5496295760424", "city": "Sabadell"}
{"index":{"_id":4}}
{"location": "2.132605678083895,41.5370461908878", "city": "Barbera"}
{"index":{"_id":5}}
{"location": "2.151270020052683,41.497779918345415", "city": "Cerdanyola"}



4 REPLIES 4
Getting noticed

Re: get_network_devices(network_id) JSON transformation

Could you be more precise on your question ? 

 

1-What element from the output of the API do you need ?

 

2- Could you sample a complete ''geo plotting in kibana ''

 

 

 

Meraki Employee

Re: get_network_devices(network_id) JSON transformation

Hi @Farrukh 

 

Some of the information in the JSON output you have provided is very sensitive, it is not a good idea to post it publicly as it could be used for malicious activity. Can you please mask out the serial number, network id, lat/lng of the device, please? This information is sensitive and it is always a good idea to protect them.

 

Cheers!

 

Raj

If you found this post helpful, please give it kudos. If my answer solved your problem, click "accept as solution" so that others can benefit from it
Here to help

Re: get_network_devices(network_id) JSON transformation

actual it is Cisco test lab no need to worry 

Here to help

Re: get_network_devices(network_id) JSON transformation

for kibana the mapping information have to be in the formate below 

{
   "mappings": {
      "_doc": {
         "properties": {
            "location": {
               "type": "geo_point"
            }
         }
      }
   }
}

and sample data look like this

{"index":{"_id":1}}
{"location": "2.089330000000046,41.47367000000008", "city": "SantCugat"}
{"index":{"_id":2}}
{"location": "2.2947825000000677,41.601800991000076", "city": "Granollers"}
{"index":{"_id":3}}
{"location": "2.1105957495300474,41.5496295760424", "city": "Sabadell"}
{"index":{"_id":4}}
{"location": "2.132605678083895,41.5370461908878", "city": "Barbera"}
{"index":{"_id":5}}
{"location": "2.151270020052683,41.497779918345415", "city": "Cerdanyola"}



Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.