Hi,
i have message in javascript format which i get from TheHive. I would like then to get object payload.object.tags and put that tag in prepared curl. I have this working when there is only one tag in message. The issue is with multiple tags within one message, cause for the curl, each tag has to be separated by comma, and also have parenthesis: "xxx","xxx","xxx".
Can someone please help me with extracting/updating tags so i can use it in curl accordingly?
Curl example working when there is only one tag:
curl -X POST -uuser:password -k -H 'Content-type: application/json' -H 'kbn-xsrf: true' https://xxxxxx -d '
{
"signal_ids": [
"{{payload.object.tags}}" //putting tags here, example for case with one tag in javascript msg
],
"status": "close"
}'
Example tag format i get in curl -> desired form:
aaaaa,bbbbb,ccccc -> "aaaaa","bbbbb","ccccc"
Now that i look at it, it might be just enough to replace: , by: ","
but it is possible there will be different stuff to get/parse out from tags in future, so dont know if that is the best solution.
Also, as probably visible, i have 0 experience with javascript and just started learning it for this purpose only. Thanks for any advice.