<?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 the value from the field using rex sed cmd in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-value-from-the-field-using-rex-sed-cmd/m-p/627045#M217924</link>
    <description>&lt;P&gt;Given the rigidity of data format, another method is split and mvindex.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval output = mvindex(split(field1, "\\"), 3) ``` SPL array is 0-based ```&lt;/LI-CODE&gt;&lt;P&gt;Searching fixed patterns is usually less expensive than regex.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2023 09:23:46 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2023-01-13T09:23:46Z</dc:date>
    <item>
      <title>How to extract the value from the field using rex sed cmd?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-value-from-the-field-using-rex-sed-cmd/m-p/627018#M217917</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I looking for rex sed cmd to extract the value from the field.&lt;BR /&gt;eg:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input field1 =&amp;nbsp;d:\AppDynamics\machineagent\ver22.2.0.3282\bin\MachineAgentService.exe&lt;/P&gt;
&lt;P&gt;output =&amp;nbsp;ver22.2.0.3282&lt;/P&gt;
&lt;P&gt;I need a valid sed cmd to filter the value everything before 3rd backslash and after 4th backslash.&lt;BR /&gt;eg:&amp;nbsp;|rex field=version mode=sed "s/ /\*/g"&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Babu&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 17:37:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-value-from-the-field-using-rex-sed-cmd/m-p/627018#M217917</guid>
      <dc:creator>Babuduraiswamy</dc:creator>
      <dc:date>2023-01-13T17:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: extract the value from the field using rex sed cmd</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-value-from-the-field-using-rex-sed-cmd/m-p/627025#M217918</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252422"&gt;@Babuduraiswamy&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;sorry, let me understand: do you want to extract a field that's a part of field1 or replace a part of field1?&lt;/P&gt;&lt;P&gt;sec cmd is used to replace a part of a string, not for extract a field.&lt;/P&gt;&lt;P&gt;If you want to extract the third part of your path in field1, you can use a rex command like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=field1 "^\w:\\([^\\]+\\){2}(?&amp;lt;version&amp;gt;[^\\]+)"&lt;/LI-CODE&gt;&lt;P&gt;you can test the regex at&amp;nbsp;&lt;A href="https://regex101.com/r/Oy7Gxt/1" target="_blank"&gt;https://regex101.com/r/Oy7Gxt/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 07:05:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-value-from-the-field-using-rex-sed-cmd/m-p/627025#M217918</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-01-13T07:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: extract the value from the field using rex sed cmd</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-value-from-the-field-using-rex-sed-cmd/m-p/627045#M217924</link>
      <description>&lt;P&gt;Given the rigidity of data format, another method is split and mvindex.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval output = mvindex(split(field1, "\\"), 3) ``` SPL array is 0-based ```&lt;/LI-CODE&gt;&lt;P&gt;Searching fixed patterns is usually less expensive than regex.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 09:23:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-value-from-the-field-using-rex-sed-cmd/m-p/627045#M217924</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-01-13T09:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: extract the value from the field using rex sed cmd</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-value-from-the-field-using-rex-sed-cmd/m-p/627097#M217932</link>
      <description>&lt;P&gt;Thanks, mvindex got worked..&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 19:25:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-value-from-the-field-using-rex-sed-cmd/m-p/627097#M217932</guid>
      <dc:creator>Babuduraiswamy</dc:creator>
      <dc:date>2023-01-13T19:25:30Z</dc:date>
    </item>
  </channel>
</rss>

