<?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: Regrex Command to split string in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-use-Regrex-Command-to-split-string/m-p/629167#M51608</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248664"&gt;@ichesla1111&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| rex field=filename "^\d+-(?&amp;lt;hh&amp;gt;\d\d)(?&amp;lt;mm&amp;gt;\d\d)(?&amp;lt;ss&amp;gt;\d\d)"
| eval Starttime = hh.":".mm.":".ss
| table Starttime&lt;/LI-CODE&gt;&lt;P&gt;you can test the regex at&amp;nbsp;&lt;A href="https://regex101.com/r/8mQ7WB/1" target="_blank"&gt;https://regex101.com/r/8mQ7WB/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 01 Feb 2023 16:06:23 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-02-01T16:06:23Z</dc:date>
    <item>
      <title>How can I use Regrex Command to split string?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-use-Regrex-Command-to-split-string/m-p/629164#M51607</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;&lt;BR /&gt;I am caluclating utilization (already done), but I want to fix my event start times.&lt;BR /&gt;&lt;BR /&gt;The start time for a run on a machine is located in the filename, but I am having&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;difficulty doing the regrex command&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and &lt;STRONG&gt;understanding how it works.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ex. Filename String:&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;013023-123141-46.xml&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;Step1:&lt;/U&gt; Extract middle string (highlighted in red):&lt;BR /&gt;&lt;BR /&gt;013023-123141-46.xml --&amp;gt;WANT:&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;FONT color="#800000"&gt;"123141"&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Step2:&lt;/U&gt; Add ":" between every other number (highlighted in red):&lt;BR /&gt;"123141" --&amp;gt; Final string: "&lt;FONT color="#800000"&gt;12:31:41&lt;/FONT&gt;"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;Step3:&lt;/U&gt; Convert time string "12:31:41" into a time stamp:&lt;BR /&gt;Field: Starttime = strftime(Start_Time,"%h:%m:%s")&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 17:30:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-use-Regrex-Command-to-split-string/m-p/629164#M51607</guid>
      <dc:creator>ichesla1111</dc:creator>
      <dc:date>2023-02-01T17:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Regrex Command to split string</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-use-Regrex-Command-to-split-string/m-p/629167#M51608</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248664"&gt;@ichesla1111&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| rex field=filename "^\d+-(?&amp;lt;hh&amp;gt;\d\d)(?&amp;lt;mm&amp;gt;\d\d)(?&amp;lt;ss&amp;gt;\d\d)"
| eval Starttime = hh.":".mm.":".ss
| table Starttime&lt;/LI-CODE&gt;&lt;P&gt;you can test the regex at&amp;nbsp;&lt;A href="https://regex101.com/r/8mQ7WB/1" target="_blank"&gt;https://regex101.com/r/8mQ7WB/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 16:06:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-use-Regrex-Command-to-split-string/m-p/629167#M51608</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-02-01T16:06:23Z</dc:date>
    </item>
  </channel>
</rss>

