All Apps and Add-ons

Using REST Command To Create HyperLink In Dashboard In Order To Export Specific Fields From Base Search Results

jpass
Contributor

I'm using SideView Utils with a Search Module, PostProcess Module and a HTML Module. My base search (Search Module) works perfectly to run the entire dashboard. The only problem is that my users only need to export a few of the fields from the base search. If they export the base search, the data is way overkill and more complicated looking then I want it to be.

I've figured out how to generate a customized export of the base search like this:

  1. I get the currently logged in user with a SEARCH like this:

    | rest /services/authentication/current-context/context | FIELDS username
    
  2. $current_user$ is a token created by a ValueSetter Module and is sent, along with some other form field values, to my base search using the Gate Module. The base search has lots of stats and calculations that run most of the entire dashboard.

  3. But when users export data, they only need a few fields, not this entire base search

  4. After the base search I have an HTML Module that uses the tokens: $results.sid$ and $username$ to create the following URL:

    https://localhost:8090/servicesNS/$current_user$/myapp/search/jobs/$results.sid$/results/export?outp...
    
  5. This URL works great to provide users with a URL to download a custom version of the base search that inlcudes only the fields they need.

But there is a problem:

  1. When I hit the API using :8089, it requires the user to login. What I want to do is provide an export link that uses the "REST COMMAND" like I do in the early step where I get the currently logged in username. This way the user wouldn't have to log in to access the custom export.

  2. I can't seem to generate a working REST command search to pull the results of the base search using and the documentation for the REST Command is kind of light.

Thanks in advance for your help.

1 Solution

jpass
Contributor

This has been asnwered by Nick from SideViewApps.com who has included a new feature in the latest version (2.7) of SideView Utils that provides this functionality.

From: http://sideviewapps.com/apps/sideview-utils/release-notes/
Added an export controller that supports postProcess, so app developers can build their own export workflows that leverage postProcess searches on existing jobs.

Thanks Nick.

View solution in original post

0 Karma

jpass
Contributor

This has been asnwered by Nick from SideViewApps.com who has included a new feature in the latest version (2.7) of SideView Utils that provides this functionality.

From: http://sideviewapps.com/apps/sideview-utils/release-notes/
Added an export controller that supports postProcess, so app developers can build their own export workflows that leverage postProcess searches on existing jobs.

Thanks Nick.

View solution in original post

0 Karma
Take the 2021 Splunk Career Survey

Help us learn about how Splunk has
impacted your career by taking the 2021 Splunk Career Survey.

Earn $50 in Amazon cash!