<?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: How do you include index/sourcetype in table data? (e.g. | table ..., ..., index) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82939#M21070</link>
    <description>&lt;P&gt;No, I did not use convert, he may be right then&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2013 04:01:17 GMT</pubDate>
    <dc:creator>asimagu</dc:creator>
    <dc:date>2013-07-03T04:01:17Z</dc:date>
    <item>
      <title>How do you include index/sourcetype in table data? (e.g. | table ..., ..., index)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82932#M21063</link>
      <description>&lt;P&gt;Hey guys, having a little trouble with this one.&lt;/P&gt;

&lt;P&gt;How does one include the index in a table. This doesn't work:&lt;/P&gt;

&lt;P&gt;(index=cwdswindows OR index=cwds)  earliest_time="-7d"| stats max(_time) AS last_seen by host | sort host | convert timeformat="%m/%d/%Y %H:%M:%S" ctime(last_seen) &lt;STRONG&gt;|  table host, last_seen, index&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I know it is pretty obvious by which index I search that is obviously the resulting index, but it would be nice if when I am sent the alert I can visibly see the source of the host and time last seen in my data table.  I'm guessing since index is not a field, but rather a source full of fields, that is the issue.  What is the way around this?&lt;/P&gt;

&lt;P&gt;Thanks for any help at all!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:14:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82932#M21063</guid>
      <dc:creator>ktrumpol</dc:creator>
      <dc:date>2020-09-28T14:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include index/sourcetype in table data? (e.g. | table ..., ..., index)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82933#M21064</link>
      <description>&lt;P&gt;it should work like that, you can try without the commas&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;table host last_seen index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jul 2013 03:19:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82933#M21064</guid>
      <dc:creator>asimagu</dc:creator>
      <dc:date>2013-07-03T03:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include index/sourcetype in table data? (e.g. | table ..., ..., index)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82934#M21065</link>
      <description>&lt;P&gt;Hm I can't imagine without commas would make the difference, but I will try when I get back to my machine tomorrow! I'll let you know.  Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 03:24:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82934#M21065</guid>
      <dc:creator>ktrumpol</dc:creator>
      <dc:date>2013-07-03T03:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include index/sourcetype in table data? (e.g. | table ..., ..., index)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82935#M21066</link>
      <description>&lt;P&gt;I tried showing the index field in a table and it worked for me with and without the commas... it's worth trying &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 03:32:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82935#M21066</guid>
      <dc:creator>asimagu</dc:creator>
      <dc:date>2013-07-03T03:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include index/sourcetype in table data? (e.g. | table ..., ..., index)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82936#M21067</link>
      <description>&lt;P&gt;You need to include &lt;EM&gt;index&lt;/EM&gt; in your &lt;EM&gt;"stats"&lt;/EM&gt; clause, otherwise it will not be present for the table clause.&lt;/P&gt;

&lt;P&gt;Initially I thought it was because you had &lt;EM&gt;"convert"&lt;/EM&gt; before rather than after &lt;EM&gt;"table"&lt;/EM&gt;, but that works either way.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 03:49:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82936#M21067</guid>
      <dc:creator>grijhwani</dc:creator>
      <dc:date>2013-07-03T03:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include index/sourcetype in table data? (e.g. | table ..., ..., index)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82937#M21068</link>
      <description>&lt;P&gt;Awesome! Thank you for trying to replicate my search to accurately diagnose the issue.  I'll be sure to try this and vote your answer if it works.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 03:57:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82937#M21068</guid>
      <dc:creator>ktrumpol</dc:creator>
      <dc:date>2013-07-03T03:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include index/sourcetype in table data? (e.g. | table ..., ..., index)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82938#M21069</link>
      <description>&lt;P&gt;Did you try using convert in your search?  The guy below said that when using convert, it has to come after table.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 03:58:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82938#M21069</guid>
      <dc:creator>ktrumpol</dc:creator>
      <dc:date>2013-07-03T03:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include index/sourcetype in table data? (e.g. | table ..., ..., index)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82939#M21070</link>
      <description>&lt;P&gt;No, I did not use convert, he may be right then&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 04:01:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82939#M21070</guid>
      <dc:creator>asimagu</dc:creator>
      <dc:date>2013-07-03T04:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include index/sourcetype in table data? (e.g. | table ..., ..., index)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82940#M21071</link>
      <description>&lt;P&gt;index is an ordinary field like any other. The reason it does not appear for you is that your stats command removes it. It will remove any field except those specified. If you really only have a single index, you modify your stats command by adding either first(index) as index, adding index to the split-by clause.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 04:49:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82940#M21071</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-07-03T04:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do you include index/sourcetype in table data? (e.g. | table ..., ..., index)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82941#M21072</link>
      <description>&lt;P&gt;Ahah!  Including index in my stats clause definitely fixed the issue.  Thank you thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 14:29:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-include-index-sourcetype-in-table-data-e-g-table/m-p/82941#M21072</guid>
      <dc:creator>ktrumpol</dc:creator>
      <dc:date>2013-07-03T14:29:39Z</dc:date>
    </item>
  </channel>
</rss>

