Is there a way to pass an ip in a YQL query statement?
The page im querying returns data based on the ip that is querying the page(date/timezone), so I'm getting data that is useless to the user that is not from the user IP.
What's the proper syntax to passing an IP if it is possible?
Thanks
You can use IP address instead of url, here is example:
SELECT * FROM html WHERE url = "93.184.216.34"
Sample curl command querying Google IP:
$ curl -G --data-urlencode 'q=SELECT * FROM html WHERE url = "216.58.210.14" AND xpath="//input"' http://query.yahooapis.com/v1/public/yql
Related
As of
https://clickhouse.com/docs/en/engines/table-engines/special/url/
we can query data from a remote HTTP/HTTPS server.
The problem is I need to pass query string to URL.
Is there any way to do it?
Look https://clickhouse.com/docs/en/sql-reference/table-functions/url
you can use
SELECT * FROM url('https://host:port/path?param=value', <format> , 'stucture')
I am using shell script to list out all the group under GITLAB. its huge number of list how can we find out all groups, its more than 30 seems. and iterate through it to find out ID of group?
if any other solution please suggest to list all the group ID.
grouplist=$(curl --header "PRIVATE-TOKEN: $1" "https://gitlab.com/api/v4/groups?per_page=100&page=30" | jq -r '.[].id')
The gitlab documentation says:
When accessed without authentication, this endpoint also supports keyset pagination:
When requesting consecutive pages of results, we recommend you use keyset pagination.
Beyond a specific offset limit (specified by max offset allowed by the REST API for offset-based pagination), offset pagination is unavailable.
See https://docs.gitlab.com/ee/api/index.html#keyset-based-pagination for more details about keyset pagination. You will have to call curl repeatedly until there are no more results:
When the end of the collection is reached and there are no additional records to retrieve, the Link header is absent and the resulting array is empty. We recommend using only the given link to retrieve the next page instead of building your own URL.
The retrieved JSON documents can then can be fed to jq.
I need to Get data for an index for a timeframe using curl or using url.
I was able to get the data using below created url
http://localhost:9200/index_name/_search?size=10&q="* AND severity:major|critical"
but I am not sure where to provide the timeframe for example i only want data from last 15minutes.
Can anyone help me with a way it can be done
You can do it like this by adding #timestamp:[now-15m TO now] to your query:
http://localhost:9200/index_name/_search?size=10&q="* AND severity:major|critical AND #timestamp:[now-15m TO now]"
I want to execute a curl request from the elasticsearch head plugin in order to delete all the similarly named indexes. I am using the following command but getting an error.
The _search endpoint doesn't support the HTTP DELETE method.
Do this instead:
In the location field, set parkingapi-farhad-*
Select the DELETE method
Click the "Request" button
You can also do it using a simple curl:
curl -XDELETE http://localhost:9500/parkingapi-farhad-*
I'm using ElasticSearch for an application in order to store and search for data.
Because it's also important to search for relationships in my particular case, I recently changed the structure of my data and I am using the _parent field now. (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-parent-field.html)
I already designed the search query, which works perfectly fine. However, I now have a problem when inserting a new child entry in my database.
It should work this way:
Without the _parent field, when I wanted to achieve this
$ curl -XPUT 'http://localhost:9200/data/child/1' -d '
I inserted the data this way using the JEST API:
client.execute(new Index.Builder(payload).index("data").type("child").build());
When I want to achieve this:
$ curl -XPOST localhost:9200/data/child?parent=154121-d'
How am I supposed to implement this using the JEST-API?
It's possible to provide a parameter for the request. The correct line of code to achieve this:
$ curl -XPOST localhost:9200/data/child?parent=154121-d'
would be achieved with this:
client.execute(new Index.Builder(payload).index("data").type("child").setParameter("parent", "154121").build());