Use Script to Autogenerate Reports is not working

Hi Team,

As per the steps given in the documentation using Curl user should be able to generate reports using custom script.
I tried the below curl command by following the steps given in the document , it's throwing me errors.
I have checked the elasticsearch and kibana services status they are up and running without any issues.
Please help me to resolve this issue.

Thanks in Advance,
Ramya

try -XPOST instead of -X POST

See some example here:

Hope this can help you!

@kavierkoo, Thanks for your reply.

No luck with -XPOST
The examples you are referring, are to load json data to Elasticsearch using POST.
I'm looking for generating Report as described here

Thanks,
Ramya

Please don't post pictures of text, they are difficult to read, impossible to search and replicate (if it's code), and some people may not be even able to see them :slight_smile:

Hi @warkolm
My apologies for that !!

Please find the command i executed

    curl -k -X POST "https://x.x.x.x:9200/\?pretty" -H 'Content-Type: application/json' -d'
    -u elastic \
    -H \u0027kbn-version: 7.6.2\u0027 \
    \u0027
    https://x.x.x.x:5601/s/cdm-reports/api/reporting/generate/csv?jobParams=it continues
\u0027'

Error :

{
  "error" : "Incorrect HTTP method for uri [/\\?pretty] and method [POST], allowed: [PUT, DELETE, HEAD, GET]",
  "status" : 405
}

Thanks,
Ramya

Thanks :slight_smile:
Remove the ?pretty and try again.

Hi @warkolm,

It's not working even after removing "?pretty"
Do you have any idea ,where can find this path :

/api/reporting/jobs/download/"autogenerated job ID"

{
  "path": "/api/reporting/jobs/download/jxzaofkc0ykpf4062305t068", 
  "job": {
    "id": "jxzaofkc0ykpf4062305t068",
    "index": ".reporting-2018.11.11",
    "jobtype": "csv",
    "created_by": "elastic",
    "payload": ..., 
    "timeout": 120000,
    "max_attempts": 3,
    "priority": 10
  }
}

Thanks,
Ramya

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.