Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get logs of a task via API #259

Closed
ghost opened this issue Jul 14, 2017 · 2 comments
Closed

Can't get logs of a task via API #259

ghost opened this issue Jul 14, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Jul 14, 2017

Problem using API to get logs of tasks

Request Type

Bug

Work Environment

Question Answer
OS version (server) Docker
OS version (client) Ubuntu
TheHive version / git hash latest 2.12.0
Package Type Docker
Browser type & version If applicable

Problem Description

I am trying to use the GET /api/case/task/:id/log but it keeps returning an empty list.

However it works if I use

POST /api/case/task/log/_search
{"query":{"_and":[{"_and":[{"_parent":{"_type":"case_task","_query":{"_id":"AV0_h2WNFclmdEbzNvAZ"}}},{"_not":{"status":"Deleted"}}]}]}}
@nadouani
Copy link
Contributor

I confirm there is an unconsistency with this API and its documentation. After reading some code, it seems that this API uses a GET method, with a JSON body (which is not good).

But basically, for now, if you call it like following:

GET /api/case/task/:taskId/log
{
    "query": {
        "_not": {
            "status": "Deleted"
        }
    }
}'

So I'll keep this issue open, to be fixed, since this API, should be changed to either a GET without any request JSON body, or POST with a body.

@nadouani nadouani added this to the 2.12.1 milestone Jul 17, 2017
@To-om
Copy link
Contributor

To-om commented Jul 24, 2017

GET /api/case/task/:id/log has been fixed.
I also add a new API POST /api/case/task/:taskId/log/_search which accepts a "query" in the request body to filter logs of the task.

@To-om To-om closed this as completed Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants