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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...