Dashboards & Visualizations

XML using > and < symbols

HattrickNZ
Motivator

I was having trouble with this search in my XML, I could not save it using the below search inside my searchString tags.
index=core ... | rex ".*,.*Process type=(?P&lt;ProcessType&gt;[^,]+)"

And I know it is something to do with this

Or writing it another way
&lt;ProcessType&gt;

0 Karma
1 Solution

HattrickNZ
Motivator

The trick was to write it as this:
index=core ... | rex ".*,.*Process type=(?P&lt;ProcessType&gt;[^,]+)"

that is use
&lt; instead of <
&gt; instead of >

Hope this helps others

View solution in original post

0 Karma

aljohnson_splun
Splunk Employee
Splunk Employee

Yeah, but what you're really looking for is the

CDATA!

It's the XML Escape. Then you don't need no pesky replacements.

A CDATA section looks like this:

<![CDATA[
stuff to escape <; &#^$(@#$
]]>

Check it:

<search>
  <query>
    <![CDATA[
      index=core ... | rex ".*,.*Process type=(?P<ProcessType>[^,]+)"
    ]]>
  </query>
  <earliest>-2y</earliest>
  <latest>-1y</latest>
</search>

HattrickNZ
Motivator

tks for that, very helpful.

0 Karma

HattrickNZ
Motivator

The trick was to write it as this:
index=core ... | rex ".*,.*Process type=(?P&lt;ProcessType&gt;[^,]+)"

that is use
&lt; instead of <
&gt; instead of >

Hope this helps others

0 Karma
Get Updates on the Splunk Community!

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...