Getting Data In

use where command with a variable that can we get from input text field

otman01
Communicator

hi,
how can we use where command with a variable that can we get from input text field

<searchTemplate>
| where product =$product$

            <input type="text" token="product ">
Tags (3)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Just a guess, but try search instead of where.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Just a guess, but try search instead of where.

---
If this reply helps you, Karma would be appreciated.

otman01
Communicator

thank you for your respons it works 🙂

0 Karma

otman01
Communicator

yes, I tried it, but the query doesn't return any result. this is my query :

|dbquery "db_sales" "SELECT model, year, product, FROM cars c , product p where v.product=p.idproduct"

| fields model, year, pays, product| where product="$product$"
any ideas

0 Karma

joao_amorim
Communicator

You are using it right but you can take a look at this http://docs.splunk.com/Documentation/Splunk/6.2.3/Viz/tokens

You probably need to change | where product =$product$ -> | where product ="$product$"

And the token field in input should not contain the space after product, token="product " -> token="product"

Try that and report, glad i could help

0 Karma
Get Updates on the Splunk Community!

Index This | Why do they call it hyper text?

November 2023 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

State of Splunk Careers 2023: Career Resilience and the Continued Value of Splunk

For the past three years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

The Great Resilience Quest: 9th Leaderboard Update

The ninth leaderboard update (11.9-11.22) for The Great Resilience Quest is out &gt;&gt; Kudos to all the ...