<?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: Add field to message using SPL request in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617959#M214767</link>
    <description>&lt;P&gt;Thank you, could you describe this case in more detail?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Oct 2022 09:59:06 GMT</pubDate>
    <dc:creator>metylkinandrey</dc:creator>
    <dc:date>2022-10-21T09:59:06Z</dc:date>
    <item>
      <title>Add field to message using SPL request?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617836#M214717</link>
      <description>&lt;P&gt;Good afternoon!&lt;BR /&gt;I have a request based on which I create an aller:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="main" sourcetype="testsystem-script707"
| eval srcMsgId_Исх_Сообщения=if(len('Correlation_srcMsgId')==0 OR isnull('Correlation_srcMsgId'),'srcMsgId','Correlation_srcMsgId')
| eventstats count as Message_Number by srcMsgId_Исх_Сообщения
| rex field=routepointID "^(?&amp;lt;Routepoint_ID_num&amp;gt;\d+)\."
| sort routepointID
| eventstats first(Routepoint_ID_num) as RouteID by srcMsgId_Исх_Сообщения
| sort _time
| eventstats first(_time) as MessageTime by srcMsgId_Исх_Сообщения
| eval Time_Now=now()
| eval diff_time=Time_Now-MessageTime
| where RouteID!=1 AND diff_time&amp;gt;15&lt;/LI-CODE&gt;
&lt;P&gt;But the alert is constantly triggering trigger on old message threads that match the conditions of the query above.&lt;BR /&gt;I would like to get rid of triggers on old chains by adding fields to messages: alert=true or alert=0. Accordingly, I would add an additional condition to my request: work only when: alert=0.&lt;BR /&gt;Tell me how to do it?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 15:00:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617836#M214717</guid>
      <dc:creator>metylkinandrey</dc:creator>
      <dc:date>2022-10-20T15:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Add field to message using SPL request</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617846#M214723</link>
      <description>&lt;P&gt;If by "adding fields to messages" you mean you want to change indexed events then know that is not possible.&amp;nbsp; Indexed data cannot be changed in any way.&lt;/P&gt;&lt;P&gt;If the alert cannot be changed to avoid false positives then you'll have to track which messages have been alerted separately, perhaps in a KVstore lookup.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 13:47:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617846#M214723</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-10-20T13:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Add field to message using SPL request</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617959#M214767</link>
      <description>&lt;P&gt;Thank you, could you describe this case in more detail?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 09:59:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617959#M214767</guid>
      <dc:creator>metylkinandrey</dc:creator>
      <dc:date>2022-10-21T09:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add field to message using SPL request</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617962#M214770</link>
      <description>&lt;P&gt;Tell me, is this not the answer to my question?&lt;/P&gt;&lt;P&gt;Found a solution from one of the forum members:&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;I found a way to "edit" the events through modifying the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;_raw&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;field - I agree it's not an elegant at all, but it works and, which is more important, the bosses are happy":&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;index=[index_name] | ...
| eval _raw = replace(_raw,"severity_id=\"".$severity_id$."\"", "severity_id=\"".$new_severity_id$."\"") 
| table _time, _raw
| collect index=[index_name]  &lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Oct 2022 11:06:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617962#M214770</guid>
      <dc:creator>metylkinandrey</dc:creator>
      <dc:date>2022-10-21T11:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Add field to message using SPL request</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617967#M214773</link>
      <description>&lt;P&gt;If that works for you then, yes, it is a solution.&amp;nbsp; Be aware that you are not *editing* the event.&amp;nbsp; You are creating a new event that is a close copy of the current event.&amp;nbsp; There are considerations, too.&amp;nbsp; First, every event so collected counts against your license quota.&amp;nbsp; Second, you're duplicating events, which may have implications for other queries that process the data.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 12:19:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617967#M214773</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-10-21T12:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Add field to message using SPL request</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617978#M214779</link>
      <description>&lt;P&gt;Tell me how to search in KVstore?&lt;BR /&gt;I tried like this:&lt;BR /&gt;| stats list(_key) as key&lt;BR /&gt;But, this field is empty.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 12:53:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617978#M214779</guid>
      <dc:creator>metylkinandrey</dc:creator>
      <dc:date>2022-10-21T12:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Add field to message using SPL request</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617983#M214783</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command by itself won't search anything.&amp;nbsp; If you've already read the KVstore collection using &lt;FONT face="courier new,courier"&gt;inputlookup&lt;/FONT&gt; then that &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command should list all available keys.&amp;nbsp; If it still doesn't work then try assigning _key to a new field.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup mykvstorelookup
| eval key=_key
| stats list(key) as key&lt;/LI-CODE&gt;&lt;P&gt;To learn more about the KVstore, see&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.1/Admin/AboutKVstore" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.1/Admin/AboutKVstore&lt;/A&gt;&lt;/P&gt;&lt;P&gt;To learn more about using the KVstore, see&amp;nbsp;&lt;A href="https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/kvstore/uselookupswithkvstore/" target="_blank"&gt;https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/kvstore/uselookupswithkvstore/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 13:16:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-field-to-message-using-SPL-request/m-p/617983#M214783</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-10-21T13:16:28Z</dc:date>
    </item>
  </channel>
</rss>

