<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Syntax question about adding custom regex fields into the XML of a dashboard in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22219#M3789</link>
    <description>&lt;P&gt;The &amp;lt; and &amp;gt; symbols need to be written as you would for HTML. They look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt; is (amp)lt;
&amp;gt; is (amp)gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;** substitute &amp;amp; for (amp) -- I'm not certain how to display them here without substitution.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Feb 2013 03:24:53 GMT</pubDate>
    <dc:creator>Ron_Naken</dc:creator>
    <dc:date>2013-02-07T03:24:53Z</dc:date>
    <item>
      <title>Syntax question about adding custom regex fields into the XML of a dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22216#M3786</link>
      <description>&lt;P&gt;My search looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="myfirewall-fw1" error_code=733100 | rex field=_raw "Current average rate is (?&amp;lt; avg &amp;gt;[^\']+) per second" | timechart max(avg) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Upon adding it to the XML of a dashboard it looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt; chart &amp;gt;
    &amp;lt; title &amp;gt;Number of Drop Rate Exceeded messages over time&amp;lt; /title &amp;gt;
    &amp;lt; searchTemplate &amp;gt;host="myfirewall-fw1" error_code=733100 | rex field=_raw "Current average rate is (?&amp;lt; avg &amp;gt;[^\']+) per second" | timechart max(avg)&amp;lt; /searchTemplate &amp;gt;
    &amp;lt; option name="charting.chart" &amp;gt;line&amp;lt; /option &amp;gt;
    &amp;lt; option name="charting.legend.placement" &amp;gt;right&amp;lt; /option &amp;gt;
&amp;lt; /chart &amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problems is that when "&amp;lt; avg &amp;gt;" is inside the XML tage &amp;lt; searchTemplate &amp;gt; I get bugs with an error saying "error parsing XML". &lt;BR /&gt;
So how do I escape out the less than and greater than signs to put that in my search in my view?&lt;/P&gt;

&lt;P&gt;Edit: The less than and greater than symbols won't show up in the post unless I add a space after them. Ignore those spaces.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2013 19:24:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22216#M3786</guid>
      <dc:creator>yumology</dc:creator>
      <dc:date>2013-02-06T19:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax question about adding custom regex fields into the XML of a dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22217#M3787</link>
      <description>&lt;P&gt;You might want to try using the search for your dashboard in a normal search first to refine it before putting it in your dashboard XML.&lt;/P&gt;

&lt;P&gt;I think the problem is escaping the backslash.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[^\']+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[^\\']+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You may need to use a third backslash in order to escape out the slash all the way and have both the backslash and the single quote as part of the negated character class.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2013 19:31:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22217#M3787</guid>
      <dc:creator>Rob</dc:creator>
      <dc:date>2013-02-06T19:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax question about adding custom regex fields into the XML of a dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22218#M3788</link>
      <description>&lt;P&gt;I can't really see your code because XML isn't permmited to be displayed properly...&lt;BR /&gt;
It is not the \ that is the problem. It is simply the fact that the XML thinks it sees an XML tag inside an XML tag and errors on the parsing.&lt;BR /&gt;
I was able to put this into it's on search then call it in the dashboard. However, my dashboard has a form element so my search actually looks like this:&lt;/P&gt;

&lt;P&gt;host=$host$ error_code=733100 | ...&lt;/P&gt;

&lt;P&gt;The form grabs the host and puts it in the $host$ variable. It doesn't seem to pass into a search though and so it's not working.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2013 20:34:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22218#M3788</guid>
      <dc:creator>yumology</dc:creator>
      <dc:date>2013-02-06T20:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax question about adding custom regex fields into the XML of a dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22219#M3789</link>
      <description>&lt;P&gt;The &amp;lt; and &amp;gt; symbols need to be written as you would for HTML. They look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt; is (amp)lt;
&amp;gt; is (amp)gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;** substitute &amp;amp; for (amp) -- I'm not certain how to display them here without substitution.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2013 03:24:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22219#M3789</guid>
      <dc:creator>Ron_Naken</dc:creator>
      <dc:date>2013-02-07T03:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax question about adding custom regex fields into the XML of a dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22220#M3790</link>
      <description>&lt;P&gt;Have you tried checking the search job inspector to see what it tells you when you open that dashboard in a new window?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2013 20:49:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22220#M3790</guid>
      <dc:creator>Rob</dc:creator>
      <dc:date>2013-02-07T20:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax question about adding custom regex fields into the XML of a dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22221#M3791</link>
      <description>&lt;P&gt;Thanks. This combined with a little more searching helped me find the syntax. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/3435/escape-and-in-the-xml-of-dashboards?utm_source=supportcase&amp;amp;utm_medium=link&amp;amp;utm_campaign=relatedanswers&amp;amp;utm_term=Syntax+error+when+adding+regex%27s+in+the+XML+of+a+dashboard"&gt;http://splunk-base.splunk.com/answers/3435/escape-and-in-the-xml-of-dashboards?utm_source=supportcase&amp;amp;utm_medium=link&amp;amp;utm_campaign=relatedanswers&amp;amp;utm_term=Syntax+error+when+adding+regex%27s+in+the+XML+of+a+dashboard&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2013 20:49:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Syntax-question-about-adding-custom-regex-fields-into-the-XML-of/m-p/22221#M3791</guid>
      <dc:creator>yumology</dc:creator>
      <dc:date>2013-02-07T20:49:57Z</dc:date>
    </item>
  </channel>
</rss>

