<?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: Substituting key values on raw text in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Substituting-key-values-on-raw-text/m-p/583307#M203116</link>
    <description>&lt;P&gt;Assuming you're running this during search time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quick and dirty:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval _raw="Accepted public key for user ".user." from ".src_ip&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dynamic:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach user src_ip [eval _raw=replace(_raw, "\$&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;\$", '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Feb 2022 02:10:25 GMT</pubDate>
    <dc:creator>johnhuang</dc:creator>
    <dc:date>2022-02-02T02:10:25Z</dc:date>
    <item>
      <title>Substituting key values on raw text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Substituting-key-values-on-raw-text/m-p/583304#M203115</link>
      <description>&lt;P&gt;Let's say I have a CSV input with the following columns:&amp;nbsp; _raw,user,src_ip&lt;BR /&gt;&lt;BR /&gt;The _raw event is:&amp;nbsp; "Accepted public key for user $user$ from $src_ip$"&lt;BR /&gt;&lt;BR /&gt;Is there a way to replace $user$ and $src_ip$ in _raw with the values of the corresponding fields?&lt;BR /&gt;&lt;BR /&gt;I tried using "foreach" and "rex" in sedcmd mode, but it doesn't look like rex understands &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; and '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is there another way to do this?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 00:22:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Substituting-key-values-on-raw-text/m-p/583304#M203115</guid>
      <dc:creator>responsys_cm</dc:creator>
      <dc:date>2022-02-02T00:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Substituting key values on raw text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Substituting-key-values-on-raw-text/m-p/583307#M203116</link>
      <description>&lt;P&gt;Assuming you're running this during search time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quick and dirty:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval _raw="Accepted public key for user ".user." from ".src_ip&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dynamic:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach user src_ip [eval _raw=replace(_raw, "\$&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;\$", '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 02:10:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Substituting-key-values-on-raw-text/m-p/583307#M203116</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-02-02T02:10:25Z</dc:date>
    </item>
  </channel>
</rss>

