<?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: Is it possible to get field values from metadata results? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-get-field-values-from-metadata-results/m-p/285581#M54544</link>
    <description>&lt;P&gt;What field values you're interested in?? If you want to look for actual events from that source, you can use result above as subsearch OR in a map command.&lt;/P&gt;

&lt;P&gt;Subsearch&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* [| metadata index=* type=sources  | eval age = now()-lastTime | where age &amp;gt; 7 | table source ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Map &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata index=* type=sources  | eval age = now()-lastTime | where age &amp;gt; 7 | table source | map maxsearches=100 search="index=* source=$source$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Feb 2016 15:17:50 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-02-10T15:17:50Z</dc:date>
    <item>
      <title>Is it possible to get field values from metadata results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-get-field-values-from-metadata-results/m-p/285580#M54543</link>
      <description>&lt;P&gt;I'm running a command to get a list of source types that haven't had data in 7 days, so in short, I'm looking for stuff that is no longer sending in data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata index=* type=sources  | eval age = now()-lastTime | where age &amp;gt; 7 | convert ctime(lastTime)  | convert ctime(firstTime)  | convert timeformat="%Y %D" mktime(age) | fields source,firstTime, lastTime,age
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which returns records using meta data and the source name. Is it possible to search that further and get field values?&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1048i6180EF99FFCA3A14/image-size/large?v=v2&amp;amp;px=999" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 12:38:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-get-field-values-from-metadata-results/m-p/285580#M54543</guid>
      <dc:creator>arrowecssupport</dc:creator>
      <dc:date>2016-02-10T12:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get field values from metadata results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-get-field-values-from-metadata-results/m-p/285581#M54544</link>
      <description>&lt;P&gt;What field values you're interested in?? If you want to look for actual events from that source, you can use result above as subsearch OR in a map command.&lt;/P&gt;

&lt;P&gt;Subsearch&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* [| metadata index=* type=sources  | eval age = now()-lastTime | where age &amp;gt; 7 | table source ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Map &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata index=* type=sources  | eval age = now()-lastTime | where age &amp;gt; 7 | table source | map maxsearches=100 search="index=* source=$source$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Feb 2016 15:17:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-get-field-values-from-metadata-results/m-p/285581#M54544</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-10T15:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get field values from metadata results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-get-field-values-from-metadata-results/m-p/285582#M54545</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm confused about your question. You are saying you want a list of sourcetypes but you are then running a query that reports sources.&lt;BR /&gt;
I've also noticed your age filter is wrong because age will be in seconds. In summary I would try the following query instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata index=* type=sourcetypes  
| eval ageInDays = round((now()-lastTime)/86400)
| where ageInDays &amp;gt; 7 
| convert ctime(lastTime)  
| convert ctime(firstTime)  
| convert timeformat="%Y %D" mktime(ageInDays) 
| table sourcetype, firstTime, lastTime, ageInDays
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you also want to return some field values you can try something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata index=* type=sourcetypes  
| eval ageInDays = round((now()-lastTime)/86400)
| where ageInDays &amp;gt; 7 
| table sourcetype, ageInDays
| map maxsearches=100 search="metasearch index=* sourcetype=$sourcetype$ | head 1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if that helps&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 15:27:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-get-field-values-from-metadata-results/m-p/285582#M54545</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-02-10T15:27:06Z</dc:date>
    </item>
  </channel>
</rss>

