0

when i use the DevTools in ElasticSearch, to get infos for a POD : enter image description here

it’s gives me about 310 lines: enter image description here

but when i did that inside of my elixir application:

logs = HTTPoison.get("https://x.x.x.x:9200/lo*/_search?q=kubernetes.pod_name:logs-dep-test-7469c67667-fcrzh", hackney: [:insecure, basic_auth: {"xxxx", "xxxxx"}])

it’s gives me incomplet response ( just maybe 150lines ) can anyone gives me some ideas please !

Adam Millerchip
  • 20,844
  • 5
  • 51
  • 74
  • Are you running this from inside `iex`? Are you sure it's an incomplete response, or are your responses being clipped by the default display settings? Inspections usually will limit the size of the data they return. See https://hexdocs.pm/elixir/1.12/Inspect.Opts.html e.g. `IEx.configure(inspect: [limit: :infinity])` – Everett May 24 '21 at 14:43
  • yes i use inspect function, and i think that's why i didn't get the complet response. i will try it thank you very very much – yassine ben May 24 '21 at 15:01
  • I will add it as an answer so you can accept it. – Everett May 24 '21 at 16:45

1 Answers1

0

It sounds like your responses are being clipped by the default display settings, e.g. inside iex. By default inspections will limit the size of the data returned. See Inspect.Opts e.g.

You can configure it for your iex session or by passing relevant options to the calls to IO.inspect:

IEx.configure(inspect: [limit: :infinity])
IEx.configure(inspect: [limit: :infinity, printable_limit: :infinity])
Everett
  • 8,746
  • 5
  • 35
  • 49
  • by your answer you give me a big hint to khnow that the really problem is not in the inspect function but the body of the response come from the HTTPoison is incomplet. so i was in need to deal with the large response with a method called "Async Requests" and this is the refference for anyone have the same problem: https://medium.com/@alvisesus/download-large-files-with-httpoison-async-requests-61c24a27021a – yassine ben May 25 '21 at 10:30