Splunk Search

Can I use wildcards in the lookup csv file to show a list of similar named servers?

martinjnancy
New Member

I'm using a lookup table to further define the type of servers listed in a drop down box. The csv file is manually created, so I would like to use wildcards to specify my search criteria.

From:
hostname,landscape,servertype,org
us6pb1d01,"SAP BW (PB1)",db,ccr_nmon
us6pb1a01,"SAP BW (PB1)",app,ccr_nmon
us6pb1a02,"SAP BW (PB1)",app,ccr_nmon
us6pwmd01,"WebMethods (PWM)",db,ccr_nmon
us6pwmd02,"WebMethods (PWM)",db,ccr_nmon

To:
hostname,landscape,servertype,org
us6pb1d*,"SAP BW (PB1)",db,ccr_nmon
us6pb1a*,"SAP BW (PB1)",app,ccr_nmon
us6pwmd*,"WebMethods (PWM)",db,ccr_nmon

I have the following in my transforms.conf file:

[nmon_serverlookup]
filename = ccr_serverlookup.csv
match_type = WILDCARD(servertype)

However, when I go to select a server, it is listing "us6pwmd*" and not giving a list of servers.

Here are parts of my input criteria:

  <populatingSearch earliest="$timerange.earliest$" latest="$timerange.latest$" fieldForLabel="landscape" fieldForValue="landscape">| inputlookup ccr_serverlookup.csv | fields landscape | dedup landscape | table landscape</populatingSearch>
<input type="dropdown" token="servertype" searchWhenChanged="true">
  <label>Server Type:</label>
  <default>All</default>
  <choice value="*">All</choice>
  <choice value="app">Application</choice>
  <choice value="db">Database</choice>
</input>
<input type="multiselect" token="hostname" searchWhenChanged="true">
  <label>Hosts Selection:</label>
  <populatingSearch earliest="$timerange.earliest$" latest="$timerange.latest$" fieldForLabel="hostname" fieldForValue="hostname">|inputlookup ccr_serverlookup.csv | where landscape="$landscape$" AND servertype="$servertype$" | stats count by hostname | dedup hostname | sort hostname

Any suggestions??

Many thanks!

Tags (2)
0 Karma

vasanthmss
Motivator

is it working?

V
0 Karma

vasanthmss
Motivator

Add * front and back of your token based on your req like server type

inputlookup ccr_serverlookup.csv | where landscape="$landscape$" AND servertype="*$servertype$*" | stats count by hostname | dedup hostname | sort hostname
V
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...