<?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: Update Macro From Search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698969#M237311</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;for your valuable info. My lookup has full of rex Patterns (1000s of patterns), but I don't want to dump this in a macro. That's why thought to update macro only if I start seeing new Patterns in the result event. If you could help me with this specific use-case it would be very much helpful. Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Sep 2024 08:10:44 GMT</pubDate>
    <dc:creator>Thulasinathan_M</dc:creator>
    <dc:date>2024-09-13T08:10:44Z</dc:date>
    <item>
      <title>Update Macro From Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698962#M237308</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I've a case where I want to update/append the Macro with the results from lookup. I don't want to do this manually each time. So is there any way I could use a scheduled search and update macro if the lookup has any new values.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 07:19:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698962#M237308</guid>
      <dc:creator>Thulasinathan_M</dc:creator>
      <dc:date>2024-09-13T07:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Update Macro From Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698964#M237309</link>
      <description>&lt;P&gt;If there were a way to update a macro, it would likely to have a ReST endpoint, but there doesn't appear to be one. Having said that, even if there were, this sounds like a risky thing to be doing anyway. Perhaps a better way would be to update a lookup or kv store with the results from your search so that the macro can use those i.e. keep the processing (defined by the macro) separate from the data (found by the search). What you seem to be asking for smacks of self-modifying code, which, while it may sound like a cool thing to do, is generally not a safe practice.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 07:34:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698964#M237309</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-09-13T07:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Update Macro From Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698969#M237311</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;for your valuable info. My lookup has full of rex Patterns (1000s of patterns), but I don't want to dump this in a macro. That's why thought to update macro only if I start seeing new Patterns in the result event. If you could help me with this specific use-case it would be very much helpful. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 08:10:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698969#M237311</guid>
      <dc:creator>Thulasinathan_M</dc:creator>
      <dc:date>2024-09-13T08:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Update Macro From Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698971#M237312</link>
      <description>&lt;P&gt;Does your look up have 1000s of patterns or your macro has 1000s of patterns or both?&lt;/P&gt;&lt;P&gt;Where do these patterns come from?&lt;/P&gt;&lt;P&gt;Please explain with a bit more detail and examples what your usecase is?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 08:29:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698971#M237312</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-09-13T08:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Update Macro From Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698972#M237313</link>
      <description>&lt;P&gt;I have 1000s of rex Patterns which is already available in a lookup file, but I don't want to put everything into macro. So I thought to update macro only if I start seeing events match any of rex pattern in lookup but not in macro. So by doing this I have minimal rex pattern in macro (For now I've 232 rex patterns in macro).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 08:37:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698972#M237313</guid>
      <dc:creator>Thulasinathan_M</dc:creator>
      <dc:date>2024-09-13T08:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Update Macro From Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698977#M237314</link>
      <description>&lt;P&gt;So let me see if I have understood:&lt;/P&gt;&lt;P&gt;You have 1000s of patterns in a lookup which you use against a set of events and if any of the events match against a pattern in the lookup you copy that pattern into a macro? And this is the process you want to automate?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 08:57:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698977#M237314</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-09-13T08:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Update Macro From Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698978#M237315</link>
      <description>&lt;P class="lia-align-left"&gt;Let's say below are few rex Patterns available in my lookup&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=LogLine mode=sed "s|(Deprecated configuration detected in path).*( Please update your settings to use the latest configuration options.)|\1 \2|g"
| rex field=LogLine mode=sed "s|(Query execution time exceeded the threshold:).*(seconds. Query: SELECT * FROM users WHERE last_login).*|\1 \2|g"
| rex field=LogLine mode=sed "s|(Query execution time exceeded the threshold:).*(seconds. Query: SELECT * FROM contacts WHERE contact_id).*|\1 \2|g"&lt;/LI-CODE&gt;&lt;P class="lia-align-left"&gt;&lt;BR /&gt;Below are the search results, I want to use above rex Pattern:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;WARN  ConfigurationLoader - Deprecated configuration detected in path /xx/yy/zz. Please update your settings to use the latest configuration options.
WARN  ConfigurationLoader - Deprecated configuration detected in path /aa/dd/jkl. Please update your settings to use the latest configuration options.
WARN  QueryExecutor - Query execution time exceeded the threshold: 12.3 seconds. Query: SELECT * FROM users WHERE last_login &amp;gt; '2024-01-01'.
WARN  QueryExecutor - Query execution time exceeded the threshold: 21.9 seconds. Query: SELECT * FROM contacts WHERE contact_id &amp;gt; '252’.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;So I'll get something like below, if I do stats&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;LogLine&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;Count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="68px"&gt;Deprecated configuration detected in path . Please update your settings to use the latest configuration options.&lt;/TD&gt;&lt;TD width="50%" height="68px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Query execution time exceeded the threshold: seconds. Query: SELECT * FROM users WHERE last_login&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Query execution time exceeded the threshold: seconds. Query: SELECT * FROM contacts WHERE contact_id&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 13 Sep 2024 08:58:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698978#M237315</guid>
      <dc:creator>Thulasinathan_M</dc:creator>
      <dc:date>2024-09-13T08:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Update Macro From Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698979#M237316</link>
      <description>&lt;P&gt;Absolutely, correct. That's my intention and I'm bit worried if I would hit a Performance impact if I keep on updating the macro and it exceeds limit at some point. Is there any better approach I can deal with for this use-case. Happy to adapt to any better approaches.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 09:01:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698979#M237316</guid>
      <dc:creator>Thulasinathan_M</dc:creator>
      <dc:date>2024-09-13T09:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Update Macro From Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698991#M237318</link>
      <description>&lt;P&gt;Convert your lookup so it has a pattern and name for the pattern e.g.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;logline&lt;/TD&gt;&lt;TD&gt;pattern&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Deprecated configuration detected in path Please update your settings to use the latest configuration options.&lt;/TD&gt;&lt;TD width="50%"&gt;*Deprecated configuration detected in path* Please update your settings to use the latest configuration options.*&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Query execution time exceeded the threshold: seconds. Query: SELECT * FROM users WHERE last_login&lt;/TD&gt;&lt;TD width="50%"&gt;*Query execution time exceeded the threshold:*seconds. Query: SELECT * FROM users WHERE last_login*&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Query execution time exceeded the threshold: seconds. Query: SELECT * FROM contacts WHERE contact_id&lt;/TD&gt;&lt;TD width="50%"&gt;*Query execution time exceeded the threshold:*seconds. Query: SELECT * FROM contacts WHERE contact_id*&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Then add a lookup definition and use advanced option to set WILDCARD(pattern)&lt;/P&gt;&lt;P&gt;Now you can use lookup on your events to find out which type of loglines you have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| lookup patterns.csv pattern as _raw
| stats count by logline&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 10:15:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/698991#M237318</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-09-13T10:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Update Macro From Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/699007#M237324</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;. It's working as expected &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 11:28:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Update-Macro-From-Search/m-p/699007#M237324</guid>
      <dc:creator>Thulasinathan_M</dc:creator>
      <dc:date>2024-09-13T11:28:59Z</dc:date>
    </item>
  </channel>
</rss>

