<?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: Collecting a list of fields with particular values in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131702#M27088</link>
    <description>&lt;P&gt;Thanks for the query yannK. I don't think I explained what I was looking for very well. I was able to work out a solution that I will post below.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Apr 2014 02:33:38 GMT</pubDate>
    <dc:creator>Runals</dc:creator>
    <dc:date>2014-04-15T02:33:38Z</dc:date>
    <item>
      <title>Collecting a list of fields with particular values</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131700#M27086</link>
      <description>&lt;P&gt;I'm trying to pull the tags associated with my different eventtypes using the following query. &lt;/P&gt;

&lt;P&gt;| rest /servicesNS/-/-/configs/conf-tags  | dedup eai:appName title&lt;/P&gt;

&lt;P&gt;The problem is there is no one field for tags. If there is a tag name it shows up as a field with values of either enabled or disabled. The question is how to pull out the fields and associate it with title field value in this event.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2014 00:40:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131700#M27086</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2014-04-15T00:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Collecting a list of fields with particular values</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131701#M27087</link>
      <description>&lt;P&gt;Try that to extract the content of the "title" field then eventtype only&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| rest /servicesNS/-/-/configs/conf-tags | dedup eai:appName title | search title="&lt;EM&gt;eventtype&lt;/EM&gt;" | rex field=title "eventtype=(?&lt;EVENTTYPE&gt;.*)"  | table title eventtype&lt;/EVENTTYPE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 15 Apr 2014 01:00:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131701#M27087</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2014-04-15T01:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Collecting a list of fields with particular values</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131702#M27088</link>
      <description>&lt;P&gt;Thanks for the query yannK. I don't think I explained what I was looking for very well. I was able to work out a solution that I will post below.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2014 02:33:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131702#M27088</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2014-04-15T02:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Collecting a list of fields with particular values</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131703#M27089</link>
      <description>&lt;P&gt;There might be an easier way to do this but here is what I came up with. The key to this is specify the search head you are running the query from as you might have an app that has tags/eventtypes that aren't installed on your indexers (note the | search splunk_server= part). &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /servicesNS/-/-/configs/conf-tags | search splunk_server=splunk0  | rename eai:appName as app | foreach * [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'."##".title."##".app]| stats values(*) as *| transpose | makemv delim=" " "row 1" | mvexpand "row 1"| search "row 1"=enabled* OR "row 1"=disabled*| rex field="row 1" "^(?&amp;lt;status&amp;gt;[^\#]+)##(?&amp;lt;title&amp;gt;[^\#]+)##(?&amp;lt;app&amp;gt;[^\#]+)" | rex field=title ".+\=(?&amp;lt;title&amp;gt;.+)" | rename column as tag | table tag status title app
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With that query in hand you can combine that with a REST search for eventtypes and the searches that make them up.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /servicesNS/-/-/configs/conf-eventtypes | search splunk_server=splunk0 | rename eai:appName as app | table app title search | join max=0 app title [| rest /servicesNS/-/-/configs/conf-tags | search splunk_server=splunk0  | rename eai:appName as app | foreach * [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'."##".title."##".app]| stats values(*) as *| transpose | makemv delim=" " "row 1" | mvexpand "row 1"| search "row 1"=enabled* OR "row 1"=disabled*| rex field="row 1" "^(?&amp;lt;status&amp;gt;[^\#]+)##(?&amp;lt;title&amp;gt;[^\#]+)##(?&amp;lt;app&amp;gt;[^\#]+)" | rex field=title ".+\=(?&amp;lt;title&amp;gt;.+)" | rename column as tag | table tag status title app] | table app title search tag status | rename title as eventtype | sort app eventtype | stats list(tag) as tags list(status) as status by app eventtype search
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I like the readability the stats command gives at the end but you might want to take it off depending on how you use this.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2014 02:38:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131703#M27089</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2014-04-15T02:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Collecting a list of fields with particular values</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131704#M27090</link>
      <description>&lt;P&gt;don't forget to replace splunk_server=splunk0 with splunk_server=*&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:13:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131704#M27090</guid>
      <dc:creator>dbroggy</dc:creator>
      <dc:date>2020-09-30T00:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Collecting a list of fields with particular values</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131705#M27091</link>
      <description>&lt;P&gt;yannK I'm not sure your query works, but maybe this is what you were thinking of:&lt;BR /&gt;
| rest /servicesNS/-/-/configs/conf-tags| dedup eai:appName title| rename eai:appName AS AppTitle|search title="eventtype*"|rex field=title "eventtype=(?(.*))"|table AppTitle eventtype&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:23:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131705#M27091</guid>
      <dc:creator>dbroggy</dc:creator>
      <dc:date>2020-09-30T00:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Collecting a list of fields with particular values</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131706#M27092</link>
      <description>&lt;P&gt;I found that the above queries are chopping off many of the apps and eventtypes that are associated with the listed tags. Take a look at this shorter part of the query and compare for yourself - eg. the access tags lists eventtypes for several sourcetypes but the app column only lists one of those sourcetypes:&lt;/P&gt;

&lt;P&gt;| rest /servicesNS/-/-/configs/conf-tags  | rename eai:appName as app | foreach * [ eval &amp;lt;&amp;gt; = '&amp;lt;&amp;gt;'."##".title."##".app]| stats values(&lt;EM&gt;) as *| transpose | makemv delim=" " "row 1" | mvexpand "row 1"| search "row 1"=enabled&lt;/EM&gt; OR "row 1"=disabled*| rex field="row 1" "^(?[^#]+)##(?&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 16:27:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collecting-a-list-of-fields-with-particular-values/m-p/131706#M27092</guid>
      <dc:creator>dbroggy</dc:creator>
      <dc:date>2019-05-08T16:27:14Z</dc:date>
    </item>
  </channel>
</rss>

