Hello,
I'm trying to export the detection rules for some testing using the api. I've created two rules and I can manually export them from the gui but trying to query "api/detection_engine/rules/_export" doesn't really do anything. I've tried copy pasting the example from the export rules documentation and put the query in the dev tools console but that only produces {}. I would assume with the file_name parameter it would save a file for me.
Without the kbn: before the api then I get an invalid uri so I'm not entirely sure what's wrong.
Going further, I copied it as a curl command and added the -H "Username:Username" -H "Password:Password" to the curl command for authentication and I'm still getting nothing. Below you can see what I am doing.
POST kbn:api/detection_engine/rules/_export?exclude_export_details=true&file_name=exported_rules.ndjson
{
"objects": [
{
"rule_id":"343580b5-c811-447c-8d2d-2ccf052c6900"
},
{
"rule_id":"61c4fdd5-83f4-4139-a9a6-6e238c0ce0d4"
}
]
}
You can also see the curl command I am doing here:
curl -X Post http://localhost:5601/api/detection_engine/rules/_export -H "kbn-xsrf: reporting" -H "Content-Type: application/json" -H "Username: Username" -H "Password: Password"