<?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: Need to parse Bluecoat VPM-XML file. this is not a XML format in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-parse-Bluecoat-VPM-XML-file-this-is-not-a-XML-format/m-p/465794#M45600</link>
    <description>&lt;P&gt;Thanks to4kawa,&lt;/P&gt;

&lt;P&gt;There is no way to create a source type instead to parse inline the file?&lt;/P&gt;

&lt;P&gt;Indeed the file has 300line like this.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Apr 2020 11:57:56 GMT</pubDate>
    <dc:creator>danje57</dc:creator>
    <dc:date>2020-04-02T11:57:56Z</dc:date>
    <item>
      <title>Need to parse Bluecoat VPM-XML file. this is not a XML format</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-parse-Bluecoat-VPM-XML-file-this-is-not-a-XML-format/m-p/465792#M45598</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;

&lt;P&gt;I need your help as I need to parse a file generated by bluecoat, wich contain data relative to our web proxy policy.&lt;/P&gt;

&lt;P&gt;The format is like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;;; CPL generated by Visual Policy Manager: [Thu Mar 26 14:00:04 CET 2020]
;*************************************************************
; WARNING:
;     THIS FILE IS AUTOMATICALLY GENERATED - DO NOT EDIT!
;     ANY MANUAL CHANGES TO THIS FILE WILL BE LOST WHEN VPM
;     POLICY IS REINSTALLED.
;*************************************************************


define category "Blacklisted"
    isdsdsd.com
    *sdsds.com
end category "Blacklisted"

define condition __GROUP5
    realm=admin group="admonui"
end condition __GROUP5

define condition __GROUP7
    realm=admin group="user1"
end condition __GROUP7

define condition __GROUP25
    realm=blablablabla"
end condition __GROUP25

define condition __GROUP28
    realm=bliblibli
end condition __GROUP28

;; Description:
define condition __CondList1
    url.domain="*ecurity.com"
    url.domain="sdsds*ecurity.com"
end condition __CondList1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It seams that value are between words: &lt;BR /&gt;
define XXXXX and end XXXXX&lt;/P&gt;

&lt;P&gt;We cannot predict the XXXX&lt;/P&gt;

&lt;P&gt;However XXXXX are the same to start with define and end for example&lt;BR /&gt;
 define MY_OWN_Policy&lt;BR /&gt;
    value1="dsdsds"&lt;BR /&gt;
    value2="fdfdfdfd"&lt;BR /&gt;
end MY_OWN_Policy&lt;/P&gt;

&lt;P&gt;In addition, comments are allowed using ;; before the define statement.&lt;/P&gt;

&lt;P&gt;Do you have idea on how to parse such format?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:51:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-parse-Bluecoat-VPM-XML-file-this-is-not-a-XML-format/m-p/465792#M45598</guid>
      <dc:creator>danje57</dc:creator>
      <dc:date>2020-09-30T04:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need to parse Bluecoat VPM-XML file. this is not a XML format</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-parse-Bluecoat-VPM-XML-file-this-is-not-a-XML-format/m-p/465793#M45599</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;|makeresults
| eval _raw=" ;; CPL generated by Visual Policy Manager: [Thu Mar 26 14:00:04 CET 2020]
 ;*************************************************************
 ; WARNING:
 ;     THIS FILE IS AUTOMATICALLY GENERATED - DO NOT EDIT!
 ;     ANY MANUAL CHANGES TO THIS FILE WILL BE LOST WHEN VPM
 ;     POLICY IS REINSTALLED.
 ;*************************************************************


 define category \"Blacklisted\"
     isdsdsd.com
     *sdsds.com
 end category \"Blacklisted\"

 define condition __GROUP5
     realm=admin group=\"admonui\"
 end condition __GROUP5

 define condition __GROUP7
     realm=admin group=\"user1\"
 end condition __GROUP7

 define condition __GROUP25
     realm=blablablabla\"
 end condition __GROUP25

 define condition __GROUP28
     realm=bliblibli
 end condition __GROUP28

 ;; Description:
 define condition __CondList1
     url.domain=\"*ecurity.com\"
     url.domain=\"sdsds*ecurity.com\"
 end condition __CondList1"
 | rex max_match=0 "(?ms)define (category|condition) (\"|__)(?&amp;lt;fieldname&amp;gt;\w+)[\"\s]+(?&amp;lt;fieldvalue&amp;gt;.*?)end"
 | rex field=fieldvalue mode=sed "s/\s+/ /g"
 | eval counter=mvrange(0,mvcount(fieldname))
 | stats list(field*) as field* by counter
 | foreach field* [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = mvindex('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;', counter) ]
 | eval {fieldname} = fieldvalue
 | fields - counter field*
 | stats values(*) as *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Apr 2020 10:02:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-parse-Bluecoat-VPM-XML-file-this-is-not-a-XML-format/m-p/465793#M45599</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-02T10:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need to parse Bluecoat VPM-XML file. this is not a XML format</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-parse-Bluecoat-VPM-XML-file-this-is-not-a-XML-format/m-p/465794#M45600</link>
      <description>&lt;P&gt;Thanks to4kawa,&lt;/P&gt;

&lt;P&gt;There is no way to create a source type instead to parse inline the file?&lt;/P&gt;

&lt;P&gt;Indeed the file has 300line like this.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 11:57:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-parse-Bluecoat-VPM-XML-file-this-is-not-a-XML-format/m-p/465794#M45600</guid>
      <dc:creator>danje57</dc:creator>
      <dc:date>2020-04-02T11:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need to parse Bluecoat VPM-XML file. this is not a XML format</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-parse-Bluecoat-VPM-XML-file-this-is-not-a-XML-format/m-p/465795#M45601</link>
      <description>&lt;P&gt;make transforms.conf with REGEX and FORMAT&lt;BR /&gt;
good luck&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 21:22:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-parse-Bluecoat-VPM-XML-file-this-is-not-a-XML-format/m-p/465795#M45601</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-02T21:22:57Z</dc:date>
    </item>
  </channel>
</rss>

