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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...