Set a Kibana dashboard filter through the url - elasticsearch

I created a Kibana dashboard, containing some visualization. I can successfully embed the dashboard using the provided url:
{url}/app/kibana#/dashboard/{dashboard_uuid}?embed=true&_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-1y,mode:quick,to:now))
Now, I would like to have any user of my app to see this dashboard, filtered in order to only see their data. The filter query that I need is very simple, because all the data contains a field user_id.
An example: For the user with identifier $id, I want to load the dashboard with the filter user_id:$id
In there a way to set the filter through the url? I see there are some parameters already (refreshInterval, time..) but I couldn't find the proper documentation. Any ideas?
Using Kibana 6.2.2 and ElasticSearch 6.6.0
I tried setting the filters through the _a parameter, as explained here: https://discuss.elastic.co/t/dashboard-search-parameter-via-url/84385 without success.
{url}/app/kibana#/dashboard/{dashboard_uuid}?
embed=true&
_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-1y,mode:quick,to:now))&
_a=(filters:!(),query:(querystring:(query: "user_id:1")))

I stumbled upon this while looking for a solution to a slightly similar question. I figured I would share two options that I have gotten to [mostly] work, but either should do what you are looking for.
URL With Variable Set to Application State:
../app/dashboards#/view/{dashboard_uuid}?_a=(filters:!((query:(match_phrase:(user_id:$id)))))
Using this method, the filter is not "pinned", so if you have another link on your landing dashboard, the filter will not remain if you click that link. However, your other global state settings (timeframe, etc.) do remain.
URL With Variable Set to Global State:
../app/dashboards#/view/{dashboard_uuid}?_g=(filters:!((query:(match_phrase:(user_id:$id)))))
Using this method, the filter is "pinned" and remains throughout additional clicks. However, this URL will overwrite all your other global state settings (timeframe, etc.).
This is where I am. I would like the filter to remain pinned, but if I have a time filter set as well, clicking this link will unfortunately default to the timepicker:timeDefaults setting in Kibana.
I still have not found a solution to my issue, but I hope this answers the original question; or perhaps help someone else that stumbles here (seeing as how this thread is very old now).

Related

How to keep 'search filters checks' active after changing between different categories

I'm trying to maintain the "search_filters / facets_search_wrapper" status of the checks after changing between categories, for exemple, when the user selects "size: L" and changes the category to t-shirts, keep the "size:L" check active.
I've been thinking of saving some part of the URL that identifies the selected search filters, but I don't manage to find any solution for this.
Any ideas?
Thanks for your time!
Don't use any URL parameters, think about using Local Storage where you can filter out results on DOMReady, or you can use cookies and alter results with PHP.
Facet module is completely different in PrestaShop 1.7, there i'd suggest to use cookie method, if you are working on 1.6 tho, i'd go for a JS solution.

Goal not working with pagePath filter in Analytics API

I would like to find the conversion rates for one of my goals. However, I just want to see the results based on pages with "profile/" in the URL. I've tried using the following filter separately in the Analytics API add-on for Google sheets: ga:pagePath=#profile/ or ga:pagePath=~profile
The filter works, but I don't get any conversion hits. Can anyone help?
Thanks,
Josh
Unless your goal actually is the page with the path of /profile you should use a segment rather than a filter. The difference is that a segment will give you the visits that include (exclude etc. depending on the conditions for you segment) visitors via the profile page, whereas a filter will only include pageviews to the exact /profile page.
So you are looking for a segment definition like
sessions::condition::ga:pagePath==/profile
This will limit the data to sessions that have at some point visited the profile page (but will also show what happenend before and after).
A more convinient way to get your segment definition is to define the segment in the GA interface, then head over to the query explorer and select your newly created segment via the segments dropdown. You can copy it from there (either by id or you can copy the segment definition if you click the checkbox below the dropdown).

SEO Friendly exposed filter view Drupal 7

Currently url display like this
news/?tid=telecom
I need to alias
news/telecom
using clean URL its works in all pages but in view exposed filters not worked
Have you tried views contextual filters to solve your problem?
You can also solve it using contextual filter. You can use taxonomy term names with this filter by adjusting Specify validation criteria settings. please see this answer Drupal 7 views contextual filters taxonomy name
Currently, it's my belief that the only generic way to solve this issue is either manipulating the URLs at the httpd layer, or using hook_url_inbound_alter and hook_url_outbound_alter. You can read a bit more about the mentioned hooks at this question.
However, if I were to give this another shoot myself, I would attempt a Views specific solution instead, as this problem is common enough that it could be justified to have a module for this.
In hook_views_pre_build, one could take data from a url like "members/valuea/valueb", push these values into $_GET['q'], let views build it's query seeing the get arguments "in the url", then possibly remove them again in hook_views_post_build.
I hope this will help you.

Filter the form choices visible in the browseable API

I am using a filter to apply object level permissions to a collection. Resources in a second collection have a many-to-many relationship with the first. On the browsable API, when creating resources in the second collection, the user is presented with a list of resources from the first to link it to. However, this list is not filtered, so the user can see values that they should not be able to see.
I've poked around the documentation and source a bit and I cannot see a way to add filtering to the queryset that generates the choices without overloading or modifying a bunch of code to pass the request data down (probably removing some of the collection specific data on the way) and then apply the filters.
Is there a better way to achieve this?
Currently there's nothing to support this out of the box. Pull requests are always welcome. If it's something you want to work on you may want to either open a ticket on GitHub or hit up the mailing list to discuss it first.

How to write a Google Analytics filter to record site searches

I what to record all my website searches with google analytics but the problem is my search links look like this
**www.mywebsite.com/search/category/your+query+here**
From what i found out i must give GA the query parameter (mywebsite.com/search.php?q=your+query+here) but i have none (and don't want any).
Is there a way to rewrite the URL with a google analytics filter? If yes how.
Yes, you can create a custom filter that rewrites URL /search/<category>/<query> to ?q=<query>&c=<category>.
Go to Analytics Settings › Filter Manager, and click Add Filter. Choose Custom Filter in the Filter Type drop-down list, select Search and Replace radio button, and then set two Request URI fields with the corresponding values. For further details, see ’How do I create a filter?’ page in Google Analytics Help Center.
Keep in mind! Since past visitor data cannot be reprocessed, always keep a ’raw’ profile that you do not apply filters against. For further details, see chapter ’Best Practices for Filters & Profiles’ in presentation ’Filters in Google Analytics’.
Site Search is processed BEFORE Filters are applied.
I went through a week of testing to realize this. Yes, the Filter logic is correct, but as of Nov 1, 2009 this will not work with Site Search.
We accomplished this by appeding the ?search= parameter to the page URI in the GA script. Then we strip search params in the Profile Settings and we get the pure URI's in the content section as well as the Searches tracked in Site Search.
I know this is old, but to expand on the prev accepted answer, use a 'virtual url' in the _trackPageview call, so for www.mywebsite.com/search/category/your+query+here have
gat._trackPageview( "/search/content/your+query+here?query=your+query+here&cat=category" )
This means that URLs won't be changed, so everything else works (as noted in the previous answer) - if you really want to you could remove the search params, but unless you're running into a URL limit I'd probably prefer to keep them present so they can be seen in the content reports.

Resources