I put my json data on Unmarsha1. How can i retrieve data like
log.Print(b["beat"]["name"])
but how can I retrieve data like log.Print(b["beat"]["name"]) --> fail to get data
My Code is like following:
var b map[string]interface{}
data := []byte(`
{"foo":1,"beat":{"@timestamp":"2016-10-27T12:02:00.352Z","name":"localhost.localdomain","version":"6.0.0-alpha1"}}
`)
err := json.Unmarshal(data, &b)
if err != nil{
fmt.Println("error: ", err)
}
log.Print(b)
log.Print(b["beat"]["name"])
Thank You