Dashboards & Visualizations

Dashboards and search time extraction

brywilk_umich
Path Finder

I have a search that works great that I am now building a dashboard for, the problem I am running into is that I am doing a field extraction at the time of search using rex. So when I create the dashboard and have the one token Im entering $ip$ it runs into a issue when it gets to the user field that Im extracting to feed the ldapfilter command. Is there any workaround for this? Or would all the field extraction need to occur beforehand?

src_ip=$ip$ #this is the input text token in the dashboard

(
(index=radius sourcetype=radius src_ip=*) OR   
(index=collaboration) OR 
(index=google) 
) 
| lookup dnslookup clienthost as src_dns OUTPUT clientip as x_src_ip
| eval xx_src_ip=src_ip
| eval src_ip=coalesce(xx_src_ip,x_src_ip)
| iplocation src_ip allfields=true | sort -_time  
**| rex field=user mode=sed "s/@email.edu//g" 
| ldapfilter domain=email.edu search="uid=$user$" attrs="InstRoles"**
0 Karma

somesoni2
Revered Legend

Since $ is a special character used for tokens in dashboards, you need to escape it by using 2 $ signs. LIke this

(
 (index=radius sourcetype=radius src_ip=$ip$) OR   
 (index=collaboration) OR 
 (index=google) 
 ) 
 | lookup dnslookup clienthost as src_dns OUTPUT clientip as x_src_ip
 | eval xx_src_ip=src_ip
 | eval src_ip=coalesce(xx_src_ip,x_src_ip)
 | iplocation src_ip allfields=true | sort -_time  
 **| rex field=user mode=sed "s/@email.edu//g" 
 | ldapfilter domain=email.edu search="uid=$$user$$" attrs="InstRoles"**
0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...