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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...