Project

General

Profile

Using A Custom Index » History » Version 1

Luke Murphey, 11/08/2017 07:53 AM

1 1 Luke Murphey
h1. Using A Custom Index
2 1 Luke Murphey
3 1 Luke Murphey
Version 1.2 and later of the Network Toolkit supports the ability to define an index in the URL of the various views that will cause them to do two things:
4 1 Luke Murphey
5 1 Luke Murphey
# Limit the results searched to the given index
6 1 Luke Murphey
# Cause the search commands (ping, nslookup, etc) to output to the index
7 1 Luke Murphey
8 1 Luke Murphey
You can do this by simply opening the view with the index parameter. For example, the following URL will limit the pings to the index "network_data":
9 1 Luke Murphey
10 1 Luke Murphey
<pre>
11 1 Luke Murphey
http://127.0.0.1:8000/en-US/app/network_tools/ping?index=network_data
12 1 Luke Murphey
</pre>
13 1 Luke Murphey
14 1 Luke Murphey
You can put this in a customized nav in order to direct users to the URL with the index defined. Below is an example of a navigation XML file that restricts each view to the network_data index. This file would be placed in your custom app in the directory "default/data/ui/nav/default.xml" (e.g. "$SPLUNK_HOME/etc/apps/MY_CUSTOM_APP/default/data/ui/nav/default.xml" where your app is named "MY_CUSTOM_APP").
15 1 Luke Murphey
16 1 Luke Murphey
<pre>
17 1 Luke Murphey
<nav>
18 1 Luke Murphey
  <a href='/app/network_tools/ping?index=network_data'>Ping</a>
19 1 Luke Murphey
  <a href='/app/network_tools/nslookup?index=network_data'>NSlookup</a>
20 1 Luke Murphey
  <a href='/app/network_tools/speedtest?index=network_data'>Speedtest</a>
21 1 Luke Murphey
  <a href='/app/network_tools/traceroute?index=network_data'>Traceroute</a>
22 1 Luke Murphey
  <a href='/app/network_tools/whois?index=network_data'>Whois</a>
23 1 Luke Murphey
</nav>
24 1 Luke Murphey
</pre>