Dashboards & Visualizations

How to prevent getting an error using brackets < > in a regular expression while creating a dashboard view in XML?

lksridhar
Explorer

I am using a regular expression to filter results for a drop-down created for a dashboard. I'm using xml to develop the dashboard and it seems values under this bracket < > are not allowed for use in xml. While saving the xml, I'm getting the following pop up:

 "Encountered the following error while trying to update: In handler "views" error parsing xml on line 140: Premature end of data in tag view line 1"

Please suggest if any other way I can achieve below and provide me some example.

<param name="search"> index=web="/a/b/c/d/resolvetransactionservices.log" TransactionSearchController OR TransactionSearchDelegateImpl | transaction startswith="Entered Search Transaction(s)" )"  | rex field=_raw ", Integer=\[(?<Integer>\d+)\]" | rex "=\s+(?<seconds>[\d\.]+)" 
0 Karma
1 Solution

rjthibod
Champion

Replace the brackets with their HTML versions, < becomes &lt; and > becomes &gt;. Here is the segment of your example code that should be changed.

Integer=\[(?&lt;Integer&gt;\d+)\]" | rex "=\s+(?&lt;seconds&gt;[\d\.]+)

View solution in original post

rjthibod
Champion

Replace the brackets with their HTML versions, < becomes &lt; and > becomes &gt;. Here is the segment of your example code that should be changed.

Integer=\[(?&lt;Integer&gt;\d+)\]" | rex "=\s+(?&lt;seconds&gt;[\d\.]+)

lksridhar
Explorer

Thank you very much rjthibod for your quick response and my issue got resolved now.

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...