<?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 Need help with REX, PLEASE in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-REX-PLEASE/m-p/504205#M140751</link>
    <description>&lt;P&gt;Hello, I am new to using REX wich is I believe is what I need. I have a field that has data that looks like this...&lt;BR /&gt;&lt;BR /&gt;10.231.247.162--WTLDNDAA001--Can't ping DSLAM&lt;BR /&gt;10.44.69.250--TCSUAZMS--VisibilityOnly--Can't ping DSLAM&amp;nbsp;&lt;BR /&gt;10.44.69.250--TCSUAZMS--Can't ping DSLAM--VisibilityOnly&amp;nbsp;&lt;BR /&gt;172.31.247.148--CLSPCO32H01.2--Can't ping DSLAM&amp;nbsp;&lt;BR /&gt;172.31.166.155--RSBGORBU--Can't ping DSLAM&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I want my table to ONLY show whats between the hyphens&lt;BR /&gt;&lt;BR /&gt;Example I want to get&amp;nbsp;&lt;BR /&gt;WTLDNDAA-001&lt;/P&gt;&lt;P&gt;TCSUAZMS&lt;/P&gt;&lt;P&gt;CLSPCO32H01.2&lt;/P&gt;&lt;P&gt;RSBGORBU&lt;BR /&gt;&lt;BR /&gt;Can anybody help me with creating a rex that removes everything not between the the 2 sets of hyphens.&lt;BR /&gt;&lt;BR /&gt;Would be greatly appreciated!!&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jun 2020 16:43:30 GMT</pubDate>
    <dc:creator>nathbe01</dc:creator>
    <dc:date>2020-06-12T16:43:30Z</dc:date>
    <item>
      <title>Need help with REX, PLEASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-REX-PLEASE/m-p/504205#M140751</link>
      <description>&lt;P&gt;Hello, I am new to using REX wich is I believe is what I need. I have a field that has data that looks like this...&lt;BR /&gt;&lt;BR /&gt;10.231.247.162--WTLDNDAA001--Can't ping DSLAM&lt;BR /&gt;10.44.69.250--TCSUAZMS--VisibilityOnly--Can't ping DSLAM&amp;nbsp;&lt;BR /&gt;10.44.69.250--TCSUAZMS--Can't ping DSLAM--VisibilityOnly&amp;nbsp;&lt;BR /&gt;172.31.247.148--CLSPCO32H01.2--Can't ping DSLAM&amp;nbsp;&lt;BR /&gt;172.31.166.155--RSBGORBU--Can't ping DSLAM&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I want my table to ONLY show whats between the hyphens&lt;BR /&gt;&lt;BR /&gt;Example I want to get&amp;nbsp;&lt;BR /&gt;WTLDNDAA-001&lt;/P&gt;&lt;P&gt;TCSUAZMS&lt;/P&gt;&lt;P&gt;CLSPCO32H01.2&lt;/P&gt;&lt;P&gt;RSBGORBU&lt;BR /&gt;&lt;BR /&gt;Can anybody help me with creating a rex that removes everything not between the the 2 sets of hyphens.&lt;BR /&gt;&lt;BR /&gt;Would be greatly appreciated!!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 16:43:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-REX-PLEASE/m-p/504205#M140751</guid>
      <dc:creator>nathbe01</dc:creator>
      <dc:date>2020-06-12T16:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with REX, PLEASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-REX-PLEASE/m-p/504210#M140753</link>
      <description>&lt;P&gt;The regex I would use is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--(?&amp;lt;myfield&amp;gt;[^-\n]+)--&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can see it in action here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://regex101.com/r/AbOMKk/1" target="_blank"&gt;https://regex101.com/r/AbOMKk/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or you can test it with SPL here:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval data=split("10.231.247.162--WTLDNDAA001--Can't ping DSLAM%%10.44.69.250--TCSUAZMS--VisibilityOnly--Can't ping DSLAM%%10.44.69.250--TCSUAZMS--Can't ping DSLAM--VisibilityOnly%%172.31.247.148--CLSPCO32H01.2--Can't ping DSLAM%%172.31.166.155--RSBGORBU--Can't ping DSLAM", "%%")| mvexpand data | rex field=data "--(?&amp;lt;myfield&amp;gt;[^-\n]+)--"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but as this looks like you are extracting the host, I would recommend using a props/transforms combination:&lt;/P&gt;&lt;P&gt;props.conf&lt;/P&gt;&lt;PRE&gt;[mysourcetype]
TRANSFORMS-hostoverride=mysourcetype_hostoverride&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;transforms.conf&lt;/P&gt;&lt;PRE&gt;[mysourcetype_hostoverride]
DEST_KEY = MetaData:Host
REGEX = ^\d+\.\d+\.\d+\.\d+--(?&amp;lt;myfield&amp;gt;[^-\n]+)--
FORMAT = host::$1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This regex can be tested here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://regex101.com/r/AbOMKk/2" target="_blank"&gt;https://regex101.com/r/AbOMKk/2&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 17:04:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-REX-PLEASE/m-p/504210#M140753</guid>
      <dc:creator>bshuler_splunk</dc:creator>
      <dc:date>2020-06-12T17:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with REX, PLEASE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-REX-PLEASE/m-p/504211#M140754</link>
      <description>&lt;P&gt;That worked, Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 17:15:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-REX-PLEASE/m-p/504211#M140754</guid>
      <dc:creator>nathbe01</dc:creator>
      <dc:date>2020-06-12T17:15:31Z</dc:date>
    </item>
  </channel>
</rss>

