As i am trying to generate a report dynamically and trigger it on a specified time:
The pdf report is getting generated dynamically based on the given URL and sending it as an attachment successfully but the problem here is when i try to open the attachment i was encountered with the following error:
ERROR : "Could not open dynamic_report.pdf, because it is either not supported file type or the file has been damaged (for example it was sent as an email attachment and wansn't correctly decoded)"
The code snippet is as shown below:
"actions": {
"send_email": {
"email": {
"to": [
"kiran.ila@acc.com"
],
"subject": "Watcher Report on closed tickets",
"body": {
"text": " Watcher \"{{ctx.watch_id}}\" Encountered {{ctx.payload.hits.total}} log entries, see attached data"
},
"attachments": {
"dynamic_report.pdf": {
"http": {
"content_type": "application/pdf",
"request": {
"method": "post",
"path": "http://localhost:5601/api/reporting/generate/dashboard/49c9f2a0-4602-11e7-bfa0-bde6558f0f7d?_g=()&_a=(filters:!(),viewMode:view)",
"params": {},
"headers": {
"kbn-xsrf": "reporting"
},
"auth": {
"basic": {
"username": "elastic",
"password": "****"
}
},
"read_timeout_millis": 300000
}
}
}
},
"priority": "high"
}
}
}
}
OBSERVASTION: The above code when i saved and reopened it was automatically transformed as shown below:
"actions": {
"send_email": {
"email": {
"profile": "standard",
"attachments": {
"dynamic_report.pdf": {
"http": {
"request": {
"scheme": "http",
"host": "localhost",
"port": 5601,
"method": "post",
"path": "/api/reporting/generate/dashboard/49c9f2a0-4602-11e7-bfa0-bde6558f0f7d",
"params": {
"_g": "()",
"_a": "(filters:!(),options:(darkTheme:!f),panels:!((col:1,id:f3848770-4601-11e7-bfa0-bde6558f0f7d,panelIndex:1,row:25,size_x:6,size_y:4,type:visualization),(col:1,id:'56aecc90-4600-11e7-bfa0-bde6558f0f7d',panelIndex:2,row:17,sizeype:visualization),(col:1,id:'383872d0-45ff-11e7-bfa0-bde6558f0f7d',panelIndex,viewMode:view)"
},
"headers": {
"kbn-xsrf": "reporting"
},
"auth": {
"basic": {
"username": "elastic",
"password": "****"
}
},
"read_timeout_millis": 300000
},
"content_type": "application/pdf"
}
}
},
"to": [
"kiran.ila@acc.com"
],
"subject": "Watcher Report on closed tickets",
"body": {
"text": " Watcher \"{{ctx.watch_id}}\" Encountered {{ctx.payload.hits.total}} log entries, see attached data"
}
}
}
}
Note : please dont consider the "path" and "params" as i have modified them.
Not sure why the code is being transformed as above
One More OBSERVATION : when i tried generating the PDF by navigating
DashBoards -> KPI Stats -> Reporting -> Generate Printable PDF
name of the Dashboard.
Now the generated report is found in Management->Reporting
But all the time the report generating is failing not sure why so like that, (not sure where the logs will be found for this issue)
when clicked on red icon the following error is shown:
There was an error generating your report for the "Ticket Analysis" dashboard: Max attempts reached (3)
Could you please help me out in resolving this issue.. Thanks in advance.