<?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: Extract fields in specific position in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-fields-in-specific-position/m-p/533159#M36304</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/228757"&gt;@marco_massari11&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you already extracted the location field, you can restrict the regex to the content of this field instead to the full event.&lt;/P&gt;&lt;P&gt;Then you have to create a regex that matches the rule of your field to extract:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;letters are \w&lt;/LI&gt;&lt;LI&gt;numbers are \d&lt;/LI&gt;&lt;LI&gt;the other chars are the same (e.g. "-") or eventually escaped (e.g. you have to escape = or ")")&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;in other words, you have to try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=Locatioon "(?&amp;lt;your_field&amp;gt;\w-\w\w-\w\w\w-\d\d-\w\w\w#\w\w\w\w)"&lt;/LI-CODE&gt;&lt;P&gt;regex that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/esbM8c/1" target="_blank"&gt;https://regex101.com/r/esbM8c/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you're not sure about the number of digits or letters, you can use the repeter in this way:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=Location "(?&amp;lt;your_field&amp;gt;\w-\w+-\w+-\d+-\w+#\w+)"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 15 Dec 2020 14:25:01 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-12-15T14:25:01Z</dc:date>
    <item>
      <title>Extract fields in specific position</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-fields-in-specific-position/m-p/533155#M36303</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have some logs like this:&lt;/P&gt;&lt;P&gt;fields ............................................. Location=Location#All Locations#Site#City#E-MY-SIT-00-XYZ#TEST, fields..........................&lt;/P&gt;&lt;P&gt;So I need to extract for example&amp;nbsp;E-MY-SIT-00-XYZ from Location field. The string E-MY-SIT-00-XYZ could be different but the schema is always 1Letter-2letters-3letters-2numbers-3letters. Can you help me to extract the string?&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 14:12:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-fields-in-specific-position/m-p/533155#M36303</guid>
      <dc:creator>marco_massari11</dc:creator>
      <dc:date>2020-12-15T14:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in specific position</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-fields-in-specific-position/m-p/533159#M36304</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/228757"&gt;@marco_massari11&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you already extracted the location field, you can restrict the regex to the content of this field instead to the full event.&lt;/P&gt;&lt;P&gt;Then you have to create a regex that matches the rule of your field to extract:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;letters are \w&lt;/LI&gt;&lt;LI&gt;numbers are \d&lt;/LI&gt;&lt;LI&gt;the other chars are the same (e.g. "-") or eventually escaped (e.g. you have to escape = or ")")&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;in other words, you have to try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=Locatioon "(?&amp;lt;your_field&amp;gt;\w-\w\w-\w\w\w-\d\d-\w\w\w#\w\w\w\w)"&lt;/LI-CODE&gt;&lt;P&gt;regex that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/esbM8c/1" target="_blank"&gt;https://regex101.com/r/esbM8c/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you're not sure about the number of digits or letters, you can use the repeter in this way:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=Location "(?&amp;lt;your_field&amp;gt;\w-\w+-\w+-\d+-\w+#\w+)"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 14:25:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-fields-in-specific-position/m-p/533159#M36304</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-12-15T14:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extract fields in specific position</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-fields-in-specific-position/m-p/533162#M36305</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you so much for your help. It works perfectly.&lt;/P&gt;&lt;P&gt;Ciao&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 14:41:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-fields-in-specific-position/m-p/533162#M36305</guid>
      <dc:creator>marco_massari11</dc:creator>
      <dc:date>2020-12-15T14:41:42Z</dc:date>
    </item>
  </channel>
</rss>

