<?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 How to extract values from existing field and reassign them to field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613599#M213260</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I currently have a field that contains a long string over 100+ events and in that field there are varying file sizes (609.9 KB, 1GB, 300B, etc.). What I would like to do is come up with an eval or rex command that will pull out only the file sizes and place them into a new field called File_Size. I tried using the field extractor via the GUI, but it would only pick up a couple of the file sizes and even then still wouldn’t show up in the available fields of my search. I’ve also tried creating different queries, but can’t seem to get capture groups set correctly. Can someone please advise on best approach?&lt;/P&gt;</description>
    <pubDate>Mon, 19 Sep 2022 15:44:27 GMT</pubDate>
    <dc:creator>wts408</dc:creator>
    <dc:date>2022-09-19T15:44:27Z</dc:date>
    <item>
      <title>How to extract values from existing field and reassign them to field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613599#M213260</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I currently have a field that contains a long string over 100+ events and in that field there are varying file sizes (609.9 KB, 1GB, 300B, etc.). What I would like to do is come up with an eval or rex command that will pull out only the file sizes and place them into a new field called File_Size. I tried using the field extractor via the GUI, but it would only pick up a couple of the file sizes and even then still wouldn’t show up in the available fields of my search. I’ve also tried creating different queries, but can’t seem to get capture groups set correctly. Can someone please advise on best approach?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 15:44:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613599#M213260</guid>
      <dc:creator>wts408</dc:creator>
      <dc:date>2022-09-19T15:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract values from existing field and reassign them to field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613601#M213262</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249603"&gt;@wts408&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could extract the field using the regex and then use the eval coalesce, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| rex field=File_Size "..File_Size1.."
| eval File_Size=coalesce(File_Size1,File_Size)
| ...&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 12:50:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613601#M213262</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-19T12:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extract values from existing field and reassign them to field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613607#M213266</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;- so where you say “..File_Size1..” I should put one of the actual file sizes there? I’ve tried that, but I just get an error saying the regex “xyz” does not extract anything. It should specify at least one named group. Format: (?&amp;lt;name&amp;gt;..). Thoughts?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 13:44:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613607#M213266</guid>
      <dc:creator>wts408</dc:creator>
      <dc:date>2022-09-19T13:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extract values from existing field and reassign them to field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613618#M213270</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249603"&gt;@wts408&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Sorry I wasn't so clear!&lt;/P&gt;&lt;P&gt;I haven't your logs so I cannot give you the correct regex to use.&lt;/P&gt;&lt;P&gt;With my answer I&amp;nbsp; was saying: make a regex extraction using a different name for the extracted field&amp;nbsp;&lt;SPAN&gt;File_Size1, so you can use it in the following coalesce command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 14:40:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613618#M213270</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-19T14:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extract values from existing field and reassign them to field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613621#M213271</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;- I did some tinkering and came up with the solution!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;mysearch... | rex field=_raw "FileSize: (?&amp;lt;File_Size&amp;gt;\d*.\d*\s*\w*)"&lt;BR /&gt;&lt;BR /&gt;This gave me what I was looking for, which captured all of the different file sizes and the corresponding units (MB, GB, etc.).&lt;BR /&gt;&lt;BR /&gt;Thanks for pointing me in the right direction!!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 14:47:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613621#M213271</guid>
      <dc:creator>wts408</dc:creator>
      <dc:date>2022-09-19T14:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Extract values from existing field and reassign them to field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613702#M213293</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249603"&gt;@wts408&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 06:30:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-existing-field-and-reassign-them-to/m-p/613702#M213293</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-20T06:30:03Z</dc:date>
    </item>
  </channel>
</rss>

