<?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 How to get dynamic source name from a request? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-dynamic-source-name-from-a-request/m-p/623942#M216922</link>
    <description>&lt;P&gt;Hi Folks ,&lt;/P&gt;
&lt;P&gt;I am new to splunk and trying to get dynamic source value from the response, here is my query:&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;index="itestData" AND source="/opt/ABC/DEF/GHI/KLM/LOG*" AND "error"&lt;/P&gt;
&lt;P&gt;Please note that * after LOG is a dynamic value (like LOG-A.log , LOG-B.log, LOG-C.log) and there are at least 70 servers like this, when i get any error i want to know from which log this error is coming (A or B or C and so on) .&lt;/P&gt;
&lt;P&gt;Let me know if there is any other way to get this (i do not want to individually put the name of sources as servers go up and down )&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Dec 2022 15:04:13 GMT</pubDate>
    <dc:creator>batham</dc:creator>
    <dc:date>2022-12-12T15:04:13Z</dc:date>
    <item>
      <title>How to get dynamic source name from a request?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-dynamic-source-name-from-a-request/m-p/623942#M216922</link>
      <description>&lt;P&gt;Hi Folks ,&lt;/P&gt;
&lt;P&gt;I am new to splunk and trying to get dynamic source value from the response, here is my query:&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;index="itestData" AND source="/opt/ABC/DEF/GHI/KLM/LOG*" AND "error"&lt;/P&gt;
&lt;P&gt;Please note that * after LOG is a dynamic value (like LOG-A.log , LOG-B.log, LOG-C.log) and there are at least 70 servers like this, when i get any error i want to know from which log this error is coming (A or B or C and so on) .&lt;/P&gt;
&lt;P&gt;Let me know if there is any other way to get this (i do not want to individually put the name of sources as servers go up and down )&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 15:04:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-dynamic-source-name-from-a-request/m-p/623942#M216922</guid>
      <dc:creator>batham</dc:creator>
      <dc:date>2022-12-12T15:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to get dynamic source name from a request?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-dynamic-source-name-from-a-request/m-p/623943#M216923</link>
      <description>&lt;P&gt;When you look at the output of that search you should see '&lt;FONT face="courier new,courier"&gt;host=&lt;/FONT&gt;', '&lt;FONT face="courier new,courier"&gt;source=&lt;/FONT&gt;', and '&lt;FONT face="courier new,courier"&gt;sourcetype=&lt;/FONT&gt;' values under each returned event.&amp;nbsp; Those values are exact, without wildcards.&amp;nbsp; You can can include the source field in the output using the &lt;FONT face="courier new,courier"&gt;table&lt;/FONT&gt; command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="itestData" AND source="/opt/ABC/DEF/GHI/KLM/LOG*" AND "error"
| table source&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 12 Dec 2022 01:17:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-dynamic-source-name-from-a-request/m-p/623943#M216923</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-12-12T01:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to get dynamic source name from a request?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-dynamic-source-name-from-a-request/m-p/623945#M216924</link>
      <description>&lt;P&gt;Use rex to extract the server name from the source, i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=source ".*LOG-(?&amp;lt;server&amp;gt;.*)"&lt;/LI-CODE&gt;&lt;P&gt;That will give you a new field name called 'server' - note it captures everything in the source field following LOG-&lt;/P&gt;&lt;P&gt;Then you can do whatever you want with that new field.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 02:13:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-dynamic-source-name-from-a-request/m-p/623945#M216924</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-12-12T02:13:55Z</dc:date>
    </item>
  </channel>
</rss>

