How to populate a search template parameter from a query string parameters in the SumoLogic user interface - sumologic

Using the SumoLogic Search Templates with the tourl operator combined with the ability to Use_a_URL_to_Run_a_Search
I would like to launch a search that sets the search parameters via query string arguments. I've been unable to find documentation on this ability, and it doesn't seem supported.
It seems my only option would be to create something custom that uses the API directly to get the desired behavior.
Anyone else tried this or have advice?

It is not exactly what you are asking for but have you considered just using the share url feature? This properly populates parameters prefilled and is much easier to construct to boot.
https://help.sumologic.com/Search/Get-Started-with-Search/Search-Basics/Share-a-Link-to-a-Search

Related

Adding dynamic path parameters into Orbeon Form HTTP Service

I'm trying to add a dynamic path parameter into an HTTP service in Orbeon forms, ie call a specific URL based on the content of a form field. I know we can change the query string parameters but I need to change the URL itself - the one in this field:
I've read that this is possible in newer version of Orbeon forms by using
{fr:control-string-value('testField')}
but we are stuck on an older version.
I saw another question on Stack Overflow from a few years ago: Orbeon Form HTTP Service where #ebruchez explained xpath is executed in the Resource URL field and gave the example:
http://localhost/RESTFUL/GETADDRESS/{/*/bar/foo}
However, I can't get this to work.
I have been able to successfully execute XPath, eg:
{string-join("test", "value")}
But I don't seem to be able to work out the correct Xpath syntax to dynamically select the value of a sample field and insert it into this box. I think I'm missing something in how I construct the XPath to retrieve the value.
This is what I've tried so far:
{xxf:value('testField')}
{xxf:value($testField)}
{fr:control-value($testField)}
{fr:control-value('testField')}
{xxf:property('testField')}
{xxf:property($testField)}
{$testField}
{'testField'}
{xxf:get-request-parameter('testField')}
{xxf:bind('testField')}
{/*/testField/}
{/*/content/testField/}
{//testField/}
{//*:testField/}
{//:testField/}
{(//testField)[1].text()}
{//form/content/testField/text()}
{(//testField)[1]/text()}
If anyone has any hints of advice on what I'm doing wrong or could give me an example of the syntax I put in here to retrieve a value, I'd be eternally grateful.
You can use AVT (Attribute Value Templates) https://doc.orbeon.com/xforms/core/attribute-value-templates?q=avt. In resource in <xf:submission> or HTTP service wizard use e.g. {instance('fr-form-instance')//url} or if you want edit only some part of URL you can use http://httpbin.org/{instance('fr-form-instance')//url}. I make simple form for you https://demo.orbeon.com/demo/fr/orbeon/builder/edit/18c4bee259fd9f398238b3c72041ee43ea691aa7 witch save respose to dataset and have second example in resource.
Hope this help you

Why use "?" instead of ":" in URL?

We can use
'PATCH /companies/:id' : 'CompanyController.find'
to update data.
One suggested me that I can use the alternative way:
'PATCH /companies/find?key=Value'
But I do not know what it works. Please explain me why we prefer ? mark than : mark in search path.
You can use either or. The biggest reason most people chose one or the other is just how they want to present the URL to the user.
Using a path variable (:) can symbolize you're accessing a defined resource, like a user ID, where as an argument (?) can symbolize you're are dynamically changing/searching something within a defined resource, like a token or search term.
From what I can tell that's the general practice I see:
example.com/user/:username
versus
example.com/user/?search="foo"
http://en.wikipedia.org/wiki/URL
If we are firing GET request, ? symbol is used to let the server know the url parameter variables starts from there. And this is commonly used. I didn't used : symbol instead of ?
You are probably messing the things up:
According to your example, :id indicates a variable that must me replaced by an actual value in some frameworks such as Express. See the documentation for details.
And ? indicates the beginning of the query string component according to the RFC 3986.
It's a rule to design rest api
you can find 'how to design a rest api'
Assuming below code is Sails.js
'PATCH /companies/:id' : 'CompanyController.find'
It will makes REST API that be mapped onto 'CompanyController.find' by using PathParam. Like this
www.example.com/companies/100
Second one will makes REST API by using QueryParam.
It also be mapped onto 'CompanyController.find'
/companies/find?key=Value
But the API format is different. Like this
www.example.com/companies/find?key=100
PathParam or QueryParam is fine to make REST API.
If the Key is primary for company entity,
I think PathParam is more proper than QueryParam.

Using Python RegEx in Zapier Formatter Extract Pattern

I have a field in an RSS item that includes a URL such as:
https://www.facebook.com/9999249845065110
https://www.yelp.com/biz/bix-berkeley-2?hrid=TaFUhHhVrhEJdCPjaB6RUQ
https://www.google.com/search?q=hello%20Signs%20&%20Graphics&ludocid=1720220414695611454#lrd=0x0:0x17df735a614e9c3e,1
I'm trying to setup a Zap in Zapier using the Formatter tool to essentially extract the root domain without the .com. So:
facebook
yelp
google
I have no clue how to use the Formatter Extract Pattern tool though. Can't figure out the syntax.
Best case scenario, it can look at any URL and extract the name of the site (e.g. facebook/google/yelp). If that's too complicated, then I could provide a finite list of what terms to look for and have it return the first (and only) one found. So it would check if the URL contained facebook or google or yelp and if so return that name as a value.
Any help would be appreciated. Thanks.
David here, from the Zapier Platform team.
This is totally possible. The input is the text you want to search (the full url) and the pattern is your regular expression.
In your case, you want to find the word between www. and .com. Use the regular expression www\.(\w+)\.com.
That worked for me, and pulled out yelp.
You can see each part of the regex explained here: https://regex101.com/r/KmwMAV/1
​Let me know if you've got any other questions!

Grails Override reserved work in a controller?

I am currently working on a Grails solution and I am looking to pass a URL using WSLite, I basically want to pass a bunch of query params and have them fired off. One of the params I need to have is session.name, I need this exactly like this as a 3rd party system can only read data as "session.WHATEVER". However when i enter the data below it has a problem with the "session." as it appears that session is a reserved word in grails. Is there anyway I can get grails not to pick-up the reserved word and just use session.name? Maybe by some sort of override?
def response = client.get(path:'/TestingService', query:[code:testCode, session.name: name])
Thanks
Use quotes:
query:[code:testCode, 'session.name': name]

What is the simplest way to return different content types based on the extension in the URL?

I'd like to be able to change the extension of a url and recieve the model in a different format.
e.g. if
/products/list
returns a html page containing a list of products, then
/products/list.json
would return them in a json list.
Note: I like the simplicity of the ASP.NET MVC REST SDK, it only requires about 5 lines of code to hook it in, but the format is specified as a query string parameter i.e. /products/list?format=json which is not what I want, I could tweak this code if there are no other options, but I don't want to reinvent the wheel!
I wrote a blog post that shows one possible example. It's a tiny bit complicated, but might work for your needs.
http://haacked.com/archive/2009/01/06/handling-formats-based-on-url-extension.aspx
You should be able to just use routes in conjunction with the rest sdk
If you have the flexibility to drop Apache or something similar in front of your service, you can always use mod_rewrite to rewrite an external http://products/list.json into http://products/list?format=json which your framework can render more easily.
Instead of "list.json", you could choose "list/json" and use a route like
{controller}/{action}/{id}
Then ProductController.List would be called, with an ID parameter of "json". The .List() action then would decide whether or not to return an HTML view or JSON content.

Resources