<?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: use source within map command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/use-source-within-map-command/m-p/512703#M143811</link>
    <description>&lt;P&gt;ok, but I can´t name every file.log because there are thousands...&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Aug 2020 09:47:33 GMT</pubDate>
    <dc:creator>chrkohm</dc:creator>
    <dc:date>2020-08-06T09:47:33Z</dc:date>
    <item>
      <title>use source within map command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/use-source-within-map-command/m-p/512688#M143804</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have several log files that I´m "batch indexing".&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;file01.log
file02.log
file03.log
file04.log&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I´m searching if an field equals an value like State=4&lt;/P&gt;&lt;P&gt;And now I just want to do another search that searches only in this source-files where the State was 4.&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test sourcetype=XY State=4 | stats count by source |map search="search index=test sourcetype=XY source=$source$ |stats values(cpu) by _time "&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I´m getting no results.&lt;/P&gt;&lt;P&gt;If I run the first search without the map section, I´m getting the source-files as an List&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 08:09:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/use-source-within-map-command/m-p/512688#M143804</guid>
      <dc:creator>chrkohm</dc:creator>
      <dc:date>2020-08-06T08:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: use source within map command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/use-source-within-map-command/m-p/512700#M143809</link>
      <description>&lt;P&gt;| tstats max(PREFIX("cpu=")) as cpu where index=test sourcetype=XY (source=file01.log OR source=file02.log OR source=file03.log OR source=file04.log) by PREFIX("State=") _time&lt;BR /&gt;| where 'State='=4&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 09:39:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/use-source-within-map-command/m-p/512700#M143809</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-08-06T09:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: use source within map command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/use-source-within-map-command/m-p/512703#M143811</link>
      <description>&lt;P&gt;ok, but I can´t name every file.log because there are thousands...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 09:47:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/use-source-within-map-command/m-p/512703#M143811</guid>
      <dc:creator>chrkohm</dc:creator>
      <dc:date>2020-08-06T09:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: use source within map command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/use-source-within-map-command/m-p/512705#M143812</link>
      <description>&lt;P&gt;&lt;SPAN&gt;| tstats max(PREFIX("cpu=")) as cpu where index=test sourcetype=XY [|tstats count where index=test sourcetype=XY by source| fields source | format ] by PREFIX("State=") _time&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| where 'State='=4&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;The conditions change too much.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 09:57:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/use-source-within-map-command/m-p/512705#M143812</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-08-06T09:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: use source within map command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/use-source-within-map-command/m-p/513088#M143958</link>
      <description>&lt;P&gt;I figured it out:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test sourcetype=XY cpu="*"
[search index=test sourcetype=XY State=4 |table source]
|table source State cpu
|join source [search index=test sourcetype=XY State=4 |table source State ]
|table State cpu&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 19:55:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/use-source-within-map-command/m-p/513088#M143958</guid>
      <dc:creator>chrkohm</dc:creator>
      <dc:date>2020-08-07T19:55:30Z</dc:date>
    </item>
  </channel>
</rss>

