<?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 Replacing multiple values of a field with single value with rex sed in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Replacing-multiple-values-of-a-field-with-single-value-with-rex/m-p/537837#M152058</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have field called stepName which will have below three values.&lt;/P&gt;&lt;P&gt;TextResource.getFirstLine&lt;/P&gt;&lt;P&gt;TextResource.getSecondLine&lt;/P&gt;&lt;P&gt;TextResource.getLastLine&lt;/P&gt;&lt;P&gt;How can write a rex with mode=sed to replace only the words First,Second and Last from the stepName field to "Which", so that my output will have only one stepName field value as "TextResource.getWhichLine".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jan 2021 13:36:08 GMT</pubDate>
    <dc:creator>viswatejabolla</dc:creator>
    <dc:date>2021-01-29T13:36:08Z</dc:date>
    <item>
      <title>Replacing multiple values of a field with single value with rex sed</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replacing-multiple-values-of-a-field-with-single-value-with-rex/m-p/537837#M152058</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have field called stepName which will have below three values.&lt;/P&gt;&lt;P&gt;TextResource.getFirstLine&lt;/P&gt;&lt;P&gt;TextResource.getSecondLine&lt;/P&gt;&lt;P&gt;TextResource.getLastLine&lt;/P&gt;&lt;P&gt;How can write a rex with mode=sed to replace only the words First,Second and Last from the stepName field to "Which", so that my output will have only one stepName field value as "TextResource.getWhichLine".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 13:36:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replacing-multiple-values-of-a-field-with-single-value-with-rex/m-p/537837#M152058</guid>
      <dc:creator>viswatejabolla</dc:creator>
      <dc:date>2021-01-29T13:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing multiple values of a field with single value with rex sed</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replacing-multiple-values-of-a-field-with-single-value-with-rex/m-p/537840#M152060</link>
      <description>&lt;P&gt;This should do it.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=stepName mode=sed "s/(First|Second|Last)/Which/"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 29 Jan 2021 13:52:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replacing-multiple-values-of-a-field-with-single-value-with-rex/m-p/537840#M152060</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-01-29T13:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing multiple values of a field with single value with rex sed</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replacing-multiple-values-of-a-field-with-single-value-with-rex/m-p/537862#M152064</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Rich,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks for responding. Those are not the only three which I have. There are some other stepNames as well which have same starting string and ending string. Adding all of those words to the search string will make it ugly.&lt;/P&gt;&lt;P&gt;Anything can be done like "startswith" and "endwith", or by a regex which can do this without giving all the words.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 14:49:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replacing-multiple-values-of-a-field-with-single-value-with-rex/m-p/537862#M152064</guid>
      <dc:creator>viswatejabolla</dc:creator>
      <dc:date>2021-01-29T14:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing multiple values of a field with single value with rex sed</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replacing-multiple-values-of-a-field-with-single-value-with-rex/m-p/537869#M152066</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex field=data mode=sed "s/(TextResource\.get).*(Line)/\1Which\2/"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 29 Jan 2021 15:59:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replacing-multiple-values-of-a-field-with-single-value-with-rex/m-p/537869#M152066</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-01-29T15:59:04Z</dc:date>
    </item>
  </channel>
</rss>

