<?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: How to extract a field based on character count? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-based-on-character-count/m-p/23847#M4283</link>
    <description>&lt;P&gt;This sure did it! Thanks Ayn&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2011 08:19:56 GMT</pubDate>
    <dc:creator>eamuncal</dc:creator>
    <dc:date>2011-06-07T08:19:56Z</dc:date>
    <item>
      <title>How to extract a field based on character count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-based-on-character-count/m-p/23845#M4281</link>
      <description>&lt;P&gt;I have a field name X with the following value: 0123456789. &lt;BR /&gt;
I want to create another field that is based on the first 4 characters of the field name X. &lt;BR /&gt;
Then call it Y.&lt;/P&gt;

&lt;P&gt;Any idea on how to do this? If its in bash my way would be to use cut -c1-4&lt;/P&gt;

&lt;P&gt;Trying the regex and  rex to no avail.&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;emn.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2011 07:52:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-based-on-character-count/m-p/23845#M4281</guid>
      <dc:creator>eamuncal</dc:creator>
      <dc:date>2011-06-07T07:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field based on character count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-based-on-character-count/m-p/23846#M4282</link>
      <description>&lt;P&gt;This should do it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=X "^(?&amp;lt;Y&amp;gt;\d{4})"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jun 2011 08:16:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-based-on-character-count/m-p/23846#M4282</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-06-07T08:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field based on character count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-based-on-character-count/m-p/23847#M4283</link>
      <description>&lt;P&gt;This sure did it! Thanks Ayn&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2011 08:19:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-based-on-character-count/m-p/23847#M4283</guid>
      <dc:creator>eamuncal</dc:creator>
      <dc:date>2011-06-07T08:19:56Z</dc:date>
    </item>
  </channel>
</rss>

