get_network_devices(network_id) JSON transformation

Solved
Farrukh
Getting noticed

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
Farrukh
Getting noticed

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"}



View solution in original post

4 Replies 4
RaphaelL
Kind of a big deal
Kind of a big deal

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 ''

 

 

 

Farrukh
Getting noticed

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"}



Raj66
Meraki Employee
Meraki Employee

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
Farrukh
Getting noticed

actual it is Cisco test lab no need to worry 

Get notified when there are additional replies to this discussion.