-
Notifications
You must be signed in to change notification settings - Fork 51
WILDCARDs and TLS configuration added #61
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
Conversation
Hi, this would be fantastic - is there any update? |
+1 |
Recommend changing this line , adding the TCPS scheme TCPS is the protocol I needed to use to get this to work with our AWS broker. |
Hi guys thanks for your positive comments, but I did not have any news from Grafana since 10 months :-( |
var payload = msg.Payload() | ||
var data map[string]interface{} | ||
err := json.Unmarshal([]byte(msg.Payload()), &data) | ||
data["Topic"] = msg.Topic() | ||
if err == nil { | ||
log.DefaultLogger.Info("%s", data) | ||
payload, _ = json.Marshal(data) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var payload = msg.Payload() | |
var data map[string]interface{} | |
err := json.Unmarshal([]byte(msg.Payload()), &data) | |
data["Topic"] = msg.Topic() | |
if err == nil { | |
log.DefaultLogger.Info("%s", data) | |
payload, _ = json.Marshal(data) | |
} | |
var data map[string]interface{} | |
err := json.Unmarshal([]byte(msg.Payload()), &data) | |
if err != nil { | |
log.DefaultLogger.Error("Failed to unmarshal payload of", msg) | |
return | |
} | |
data["Topic"] = msg.Topic() | |
payload, err := json.Marshal(data) | |
if err != nil { | |
log.DefaultLogger.Error("Failed to marshal data to new payload", data) | |
return | |
} |
I required the TLS config to connect to AMAZON. I also wanted to use wildcard subscritions in order to listens to multiple topics in a single subscription.
Tested with AWS IOT core.
I learned GO this morning so I could have done some things stupidly. Coming from the C++, GO looks nice.