Is there any way to parse HTML from HTTP GET request using ELK? - filebeat

I'm started using ELK stack and met a problem. I have some web-service that can give some values via HTTP API, but this values are in HTML format response. I tried to use metricbeat with http module, but it can only parse JSON format. Main idea is to send periodic GET requests like http://127.0.0.1:8090/stats/, parse HTML response data and send it to logstash. I google'd it and find no answers. Is there any way to do that with internal beats instruments? If not, can you suggest me in what direction should I dig?
Thanks!

Related

How REST API works?

enter image description here
What this picture actually describes?
I have a confusion, which is, whenever we are sending a GET request to the server via a API,
are we sending it in JSON format ?Or, in HTML or any simple Text format?
On the other hand, whenever the API is sending a request (HTTP verb actually) to the server, is it using HTTP format? and the server also returns a response in HTTP format or in JSON format?
I know this question is very silly....but I am very new in API world.
The picture is not accurate, the server sends a response and the MIME type does not matter, it can be even RDF n-triples or images depending on the type of the service and what it supports. The protocol is always HTTP, though theoretically it is possible to use a different protocol. REST has some mandatory constraints, you can read about them in the Fielding dissertation or I wrote about them here and here.

Diacritic chars encoding in API requests

I have one question about encoding diacritic chars in API request.
I can send via postman request GET /rest/city?query=Poznań, response is correct, in server logs city?query=Poznań is changed to city?query=Pozna%C5%84.
Also I have API test written in node.js (mocha, supertest) and here request GET /rest/city?query=Poznań return empty array, in server logs request method changed to GET /rest/city?query=PoznaD.
What's wrong with encoding in my API auto tests? Why ń changed to D?
Do You know how can I changed this to fix issue.
Also in logs city?query=Łódz changes in changes in city?query=Aódz
Ok, i have solution, just city?query=${encodeURI(Łódź)}

spray autochunked requests with multipart/form-data

I'm using spray-can and spray-routing to support a REST service that includes an operation to upload files. This operation accepts multipart/form-data and the formFields directive works well.
When I try to use the spray request chunking support though, I find that the formFields directive is not working as the whole multipart message is chunked and not just the one part that is large.
Has anyone got any advice on how the handle large multipart messages in spray-can?
All I can think of right now is to put the whole request data in a temp file and to use something like org.apache.commons.fileupload.MultipartStream to parse the request.

JMeter - injecting variables into a HTTP Request

I'm trying to work with JMeter to test some web services. So far so good, but I was wondering if you could do the following -
I make a http POST request to create a resource, and if successful the response comes back with the location of the resource in the headers. What I would like to do is take the value of this header, and use it in a http GET request to retrieve the resource. Is this possible with JMeter?
Any help is much appreciated
Use the regular expression extractor to extract the header value to a variable by using a regex. Then use the variable like any other variable in your GET request.

What is http multipart request?

I have been writing iPhone applications for some time now, sending data to server, receiving data (via HTTP protocol), without thinking too much about it. Mostly I am theoretically familiar with process, but the part I am not so familiar is HTTP multipart request. I know its basic structure, but the core of it eludes me.
It seems that whenever I am sending something different than plain text (like photos, music), I have to use a multipart request. Can someone briefly explain to me why it is used and what are its advantages?
If I use it, why is it better way to send photos that way?
An HTTP multipart request is an HTTP request that HTTP clients construct to send files and data over to an HTTP Server. It is commonly used by browsers and HTTP clients to upload files to the server.
What it looks like
See Multipart Content-Type
See multipart/form-data
As the official specification says, "one or more different sets of data are combined in a single body". So when photos and music are handled as multipart messages as mentioned in the question, probably there is some plain text metadata associated as well, thus making the request containing different types of data (binary, text), which implies the usage of multipart.
I have found an excellent and relatively short explanation here.
A multipart request is a REST request containing several packed REST requests inside its entity.