<?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: Docker Sources in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749010#M242073</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp;Let me interject here &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If it was just because it resulted in a multivalued field, you could happily search for just one of those values. But in case of this particular field (as well as other indexed fields which are not (supposed to be) present in the raw data) it's a bit different.&lt;/P&gt;&lt;P&gt;When you do&lt;/P&gt;&lt;PRE&gt;index=something source=aaa&lt;/PRE&gt;&lt;P&gt;and check the job log you'll get&lt;/P&gt;&lt;PRE&gt;07-01-2025 10:47:22.082 INFO UnifiedSearch [3225984 searchOrchestrator] - Expanded index search = (index=something source=aaa)&lt;BR /&gt;07-01-2025 10:47:22.082 INFO UnifiedSearch [3225984 searchOrchestrator] - base lispy: [ AND index::something source::aaa ]&lt;/PRE&gt;&lt;P&gt;This means that Splunk will only look for those events which have metadata fields of index and source with given values. In case of&amp;nbsp;&lt;EM&gt;index&lt;/EM&gt; it's not really a field but in case of source, it's gonna be a search only for indexed terms in form of source::something. Splunk will not try to bother with parsing anything out of the event itself.&lt;/P&gt;&lt;P&gt;It's in the later part of the processing pipeline that the field might get parsed out and then be used for further manipulation.&lt;/P&gt;&lt;P&gt;The problem with the obvious approach&lt;/P&gt;&lt;PRE&gt;index=something | search source=something_else&lt;/PRE&gt;&lt;P&gt;is that Splunk's optimizer will turn this seemingly superfluous search command back into&lt;/P&gt;&lt;PRE&gt;index=something source=something_else&lt;/PRE&gt;&lt;P&gt;which will end up with what I've already shown.&lt;/P&gt;&lt;P&gt;That's why I used the where command - it works differently and won't get optimized out.&lt;/P&gt;&lt;P&gt;Of course narrowing the search only to the events containing the value of "stderr" will speed the search (but won't be very effecitve if the "stderr" term appears in other terms of the event; tough luck). I'm not quite sure though if TERM() makes any difference here. I'm pretty sure just searching for "stderr" itself would suffice and it doesn't make the resulting SPL look too cryptic &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jul 2025 09:02:32 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2025-07-01T09:02:32Z</dc:date>
    <item>
      <title>Docker Sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/748979#M242070</link>
      <description>&lt;P&gt;Having some issues when looking at docker hec logs. The data is showing two sources at the same time, but does not filter on stderr or stdout when using source=stderr.&lt;/P&gt;&lt;DIV class=""&gt;&lt;UL class=""&gt;&lt;LI&gt;{ [-]&lt;BR /&gt;line: clusterrolebinding.rbac.authorization.k8s.io/ucp-kube-system:calico-node:crds unchanged&lt;BR /&gt;source: stdout&lt;BR /&gt;tag: $ucp-kubectl - 9382ee9db872&lt;BR /&gt;}&lt;BR /&gt;Show as raw text&lt;BR /&gt;host = omit&amp;nbsp; &amp;nbsp; source = http:syslog source = stdout&amp;nbsp; sourcetype = dnrc:docker&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 30 Jun 2025 21:53:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/748979#M242070</guid>
      <dc:creator>MrGlass</dc:creator>
      <dc:date>2025-06-30T21:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Docker Sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/748989#M242071</link>
      <description>&lt;P&gt;Source is one of the default metadata fields which are supposed to be indexed along the event, not included in the event. Therefore the initial search does not look for the fields parsed out from the event itself when looking for fields like source or sourcetype.&lt;/P&gt;&lt;P&gt;As a walkaround I'd try to instead of&lt;/P&gt;&lt;PRE&gt;&amp;lt;rest of your search&amp;gt; source=stderr&lt;/PRE&gt;&lt;P&gt;do&lt;/P&gt;&lt;PRE&gt;&amp;lt;rest of your search&amp;gt; stderr&lt;BR /&gt;| where source="stderr"&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Jul 2025 05:45:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/748989#M242071</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-07-01T05:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Docker Sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/748990#M242072</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/266204"&gt;@MrGlass&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are seeing source twice because it is an &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.4.2/Knowledge/Usedefaultfields#:~:text=___%3A____%27%27/%2D..%2D%27%27///.___%22-,source,-The%20source%20field" target="_self"&gt;internal field&lt;/A&gt;&amp;nbsp;as well as being specified inside your event. This can cause problems when searching for it because it has two values.&lt;/P&gt;&lt;P&gt;You might find that adding a TERM statement is enough to filter this down in order to retain performence, rather than having to search all your data and then filter by source once all the events are loaded:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=YourIndex sourcetype=dnrc:docker TERM(stderr)&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 06:07:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/748990#M242072</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-07-01T06:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Docker Sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749010#M242073</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp;Let me interject here &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If it was just because it resulted in a multivalued field, you could happily search for just one of those values. But in case of this particular field (as well as other indexed fields which are not (supposed to be) present in the raw data) it's a bit different.&lt;/P&gt;&lt;P&gt;When you do&lt;/P&gt;&lt;PRE&gt;index=something source=aaa&lt;/PRE&gt;&lt;P&gt;and check the job log you'll get&lt;/P&gt;&lt;PRE&gt;07-01-2025 10:47:22.082 INFO UnifiedSearch [3225984 searchOrchestrator] - Expanded index search = (index=something source=aaa)&lt;BR /&gt;07-01-2025 10:47:22.082 INFO UnifiedSearch [3225984 searchOrchestrator] - base lispy: [ AND index::something source::aaa ]&lt;/PRE&gt;&lt;P&gt;This means that Splunk will only look for those events which have metadata fields of index and source with given values. In case of&amp;nbsp;&lt;EM&gt;index&lt;/EM&gt; it's not really a field but in case of source, it's gonna be a search only for indexed terms in form of source::something. Splunk will not try to bother with parsing anything out of the event itself.&lt;/P&gt;&lt;P&gt;It's in the later part of the processing pipeline that the field might get parsed out and then be used for further manipulation.&lt;/P&gt;&lt;P&gt;The problem with the obvious approach&lt;/P&gt;&lt;PRE&gt;index=something | search source=something_else&lt;/PRE&gt;&lt;P&gt;is that Splunk's optimizer will turn this seemingly superfluous search command back into&lt;/P&gt;&lt;PRE&gt;index=something source=something_else&lt;/PRE&gt;&lt;P&gt;which will end up with what I've already shown.&lt;/P&gt;&lt;P&gt;That's why I used the where command - it works differently and won't get optimized out.&lt;/P&gt;&lt;P&gt;Of course narrowing the search only to the events containing the value of "stderr" will speed the search (but won't be very effecitve if the "stderr" term appears in other terms of the event; tough luck). I'm not quite sure though if TERM() makes any difference here. I'm pretty sure just searching for "stderr" itself would suffice and it doesn't make the resulting SPL look too cryptic &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 09:02:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749010#M242073</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-07-01T09:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Docker Sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749042#M242075</link>
      <description>&lt;P&gt;Using the where command did not result in any results, not sure why.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 14:08:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749042#M242075</guid>
      <dc:creator>MrGlass</dc:creator>
      <dc:date>2025-07-01T14:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Docker Sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749043#M242076</link>
      <description>&lt;P&gt;I did get results using spath, not sure if that is the best way but does seem to remove all other sources from the source field.&lt;/P&gt;&lt;P&gt;index=dnrc_docker sourcetype=dnrc:docker | spath source | search source="stderr"&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 14:09:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749043#M242076</guid>
      <dc:creator>MrGlass</dc:creator>
      <dc:date>2025-07-01T14:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Docker Sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749046#M242077</link>
      <description>&lt;P&gt;This is true, and I guess there is also a chance that the term "stderr" could exist in the log for a source=stdout log...!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tend to use TERM because I find its sometimes the easiest way to improve search performance** and not enough people know of its existence. (only 1% of Splunk Cloud customers in 2020 &lt;A href="https://conf.splunk.com/files/2020/slides/PLA1089C.pdf#page=13" target="_self"&gt;according to Rich Morgan&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 14:56:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749046#M242077</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-07-01T14:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Docker Sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749049#M242079</link>
      <description>&lt;P&gt;If it works, it works. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It's worth noting though that it's a rather "heavy" way of doing it. Spath is a fairly intensive command and you're doing it over all your events. I suppose for a one-off ad-hoc search it might be OK but if you do it often, you might want to optimize it a bit.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 16:09:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749049#M242079</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-07-01T16:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Docker Sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749054#M242083</link>
      <description>&lt;P&gt;That is intriguing because I was pretty sure it would work. I tried to recreate your case locally with makeresults | collect and it indeed doesn't find it with where. I'll keep digging.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 16:49:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749054#M242083</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-07-01T16:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Docker Sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749056#M242085</link>
      <description>&lt;P&gt;OK. It seems that even with "where" Splunk optimizes this search and it turns into&lt;/P&gt;&lt;PRE&gt;index=whatever source=CASE("stderr")&amp;nbsp;"stderr"&lt;/PRE&gt;&lt;P&gt;Which obviously again searches for the source as indexed field only. (same goes&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can make it work if you disable optimizations&lt;/P&gt;&lt;PRE&gt;index=whatever stderr&lt;BR /&gt;| noop search_optimization=false&lt;BR /&gt;| where source="stderr"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 04:05:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749056#M242085</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-07-02T04:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Docker Sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749063#M242086</link>
      <description>&lt;P&gt;This did work, but had to remove the s on optimizations and presto. Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 21:25:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749063#M242086</guid>
      <dc:creator>MrGlass</dc:creator>
      <dc:date>2025-07-01T21:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Docker Sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749071#M242088</link>
      <description>&lt;P&gt;Could be. I didn't copy-paste it but written here by hand so there might have been a typo.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 04:05:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Docker-Sources/m-p/749071#M242088</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-07-02T04:05:26Z</dc:date>
    </item>
  </channel>
</rss>

