Skip to content

Fixed curl progress output included in responds #97

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Aadniz
Copy link

@Aadniz Aadniz commented May 7, 2021

Without curl --silence, it causes the respond to contain the progress of the request, like the example below:

without silent

curl http://192.168.1.101:9200/ | cat

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   536  100   536    0     0   261k      0 --:--:-- --:--:-- --:--:--  261k
{
  "name" : "gallery",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "j7ij07pdSISexz53Rt7gPA",
  "version" : {
    "number" : "7.12.0",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "78722783c38caa25a70982b5b042074cde5d3b3a",
    "build_date" : "2021-03-18T06:17:15.410153305Z",
    "build_snapshot" : false,
    "lucene_version" : "8.8.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

with silent

curl --silent http://192.168.1.101:9200/ | cat

{
  "name" : "gallery",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "j7ij07pdSISexz53Rt7gPA",
  "version" : {
    "number" : "7.12.0",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "78722783c38caa25a70982b5b042074cde5d3b3a",
    "build_date" : "2021-03-18T06:17:15.410153305Z",
    "build_snapshot" : false,
    "lucene_version" : "8.8.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Using "cat" pipe as it gives the same result as the plugin does

@riccione
Copy link

It is a nice idea to have, however I believe it should be implemented differently. My suggestion: create a configurable variable for it and by default it can be disabled. When the configuration variable is set - you enable it.
Current implementation is straight forward and it will work for majority of users, but it lacks flexibility. In some cases it is necessary to get curl statistics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants