<?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: Bulk rename fields by regex pattern in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381201#M111518</link>
    <description>&lt;P&gt;There's a possibility of doing this by &lt;CODE&gt;rex&lt;/CODE&gt;. Can you provide some sample events?&lt;/P&gt;</description>
    <pubDate>Tue, 31 Jul 2018 18:34:44 GMT</pubDate>
    <dc:creator>sudosplunk</dc:creator>
    <dc:date>2018-07-31T18:34:44Z</dc:date>
    <item>
      <title>Bulk rename fields by regex pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381200#M111517</link>
      <description>&lt;P&gt;Basically I have a bunch of fields that are coming in foo.date.blah, where date is dynamic and the foo and blah are static.&lt;/P&gt;

&lt;P&gt;I want to basically just coalesce or bulk rename these all into a field labeled foo.blah.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 17:20:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381200#M111517</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2018-07-31T17:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk rename fields by regex pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381201#M111518</link>
      <description>&lt;P&gt;There's a possibility of doing this by &lt;CODE&gt;rex&lt;/CODE&gt;. Can you provide some sample events?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 18:34:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381201#M111518</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-07-31T18:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk rename fields by regex pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381202#M111519</link>
      <description>&lt;P&gt;@Cuyose some sample field names and their values per event would help us assist you better.&lt;BR /&gt;
Why you need &lt;CODE&gt;coalesce()&lt;/CODE&gt;? What if multiple date fields are not null but are different? &lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 19:51:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381202#M111519</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-07-31T19:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk rename fields by regex pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381203#M111520</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your current search giving all fool.&amp;lt;date&amp;gt;.blah type fields
| eval "foo.blah"=null() | foreach foo.*.blah [| eval "foo.blah"=coalesce('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;','foo.blah')]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See this runanywhere sample (instead of dates I used numbers but should work the same way for dates)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 | eval "foo.12.blah"=1 | table foo* | append [| gentimes start=-1 | eval "foo.13.blah"=2 | table foo*]  | append [| gentimes start=-1 | eval "foo.14.blah"=3 | table foo*]
| eval "foo.blah"=null() | foreach foo.*.blah [| eval "foo.blah"=coalesce('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;','foo.blah')]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Jul 2018 20:26:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381203#M111520</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-07-31T20:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk rename fields by regex pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381204#M111521</link>
      <description>&lt;P&gt;For whatever reason, this still is not working.  Your example works, however replacing verbatim the foo and bar sections with my own data fails to parse out the information.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 21:22:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381204#M111521</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2018-07-31T21:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk rename fields by regex pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381205#M111522</link>
      <description>&lt;P&gt;The field names are as follows&lt;BR /&gt;
codeDropUploadMap.20180828..qcTickets&lt;BR /&gt;
codeDropUploadMap.20180711..qcTickets&lt;BR /&gt;
codeDropUploadMap.20180804..qcTickets&lt;BR /&gt;
etc.&lt;/P&gt;

&lt;P&gt;The data contained within is a comma delimited string of id's.  each row only has values for one of the columns, if any.&lt;/P&gt;

&lt;P&gt;I used your format to do something similar with another field and it worked fine. I think it might have to do with the data within?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 14:48:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bulk-rename-fields-by-regex-pattern/m-p/381205#M111522</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2018-08-01T14:48:34Z</dc:date>
    </item>
  </channel>
</rss>

