<?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 How to get sourcetypes to TA/apps mapping via Splunk API? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-sourcetypes-to-TA-apps-mapping-via-Splunk-API/m-p/318537#M59533</link>
    <description>&lt;P&gt;As part of performance analysis, we are asked to do sourcetypes and regex analysis. The first step I wanted to see is how I can map a sourcetype to an add-on/app/TA? &lt;BR /&gt;
We have got around 2000 sourcetypes as part of a literal search coming from various TA's, so manually it is impossible.&lt;/P&gt;

&lt;P&gt;eg of what I'm looking for is something like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sourcetype,App
cisco:ise:syslog,Splunk_TA_cisco-ise
vmware:esxlog:vmkwarning,Splunk_TA_esxilogs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I know I can write scripts/grep on btool and do. but trying to think a way to do directly within Splunk&lt;/P&gt;</description>
    <pubDate>Tue, 11 Apr 2017 11:54:41 GMT</pubDate>
    <dc:creator>koshyk</dc:creator>
    <dc:date>2017-04-11T11:54:41Z</dc:date>
    <item>
      <title>How to get sourcetypes to TA/apps mapping via Splunk API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-sourcetypes-to-TA-apps-mapping-via-Splunk-API/m-p/318537#M59533</link>
      <description>&lt;P&gt;As part of performance analysis, we are asked to do sourcetypes and regex analysis. The first step I wanted to see is how I can map a sourcetype to an add-on/app/TA? &lt;BR /&gt;
We have got around 2000 sourcetypes as part of a literal search coming from various TA's, so manually it is impossible.&lt;/P&gt;

&lt;P&gt;eg of what I'm looking for is something like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sourcetype,App
cisco:ise:syslog,Splunk_TA_cisco-ise
vmware:esxlog:vmkwarning,Splunk_TA_esxilogs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I know I can write scripts/grep on btool and do. but trying to think a way to do directly within Splunk&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 11:54:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-sourcetypes-to-TA-apps-mapping-via-Splunk-API/m-p/318537#M59533</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-04-11T11:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get sourcetypes to TA/apps mapping via Splunk API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-sourcetypes-to-TA-apps-mapping-via-Splunk-API/m-p/318538#M59534</link>
      <description>&lt;P&gt;This will only work if you have the inputs on the splunk enterprise instance itself:&lt;/P&gt;

&lt;P&gt;| rest /services/configs/inputs | table eai:acl.app sourcetype | where sourcetype!=""&lt;/P&gt;

&lt;P&gt;If you're using forwarders to collect your data, you will need some sort of for loop and bat/powershell/bash scripts:&lt;/P&gt;

&lt;P&gt;bash example to be run on deployment server:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;for input in `find /opt/splunk/etc/deployment-apps -type f -name inputs.conf`; do echo $input; grep -i sourcetype $input; done
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;powershell example to be run on deployment server:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;get-childitem 'C:\Program Files\Splunk\etc\deployment-apps' -Recurse -Include "inputs.conf" -WarningAction SilentlyContinue -ErrorAction SilentlyContinue|
foreach { 
    write-host $_.FullName
    select-string $_ -pattern "sourcetype"
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;# remove Warning &amp;amp; Error Actions above if you want to see permission issues, etc... shouldnt happen if your running powershell as administrator though.&lt;/P&gt;

&lt;P&gt;You might also want to remove deployment-apps from the paths... which would then show everything under $splunk_home/etc and would work on any splunk server... if you want to run these on forwarders, again you will have to change the paths to match.  YMMV!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 12:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-sourcetypes-to-TA-apps-mapping-via-Splunk-API/m-p/318538#M59534</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-04-11T12:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get sourcetypes to TA/apps mapping via Splunk API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-sourcetypes-to-TA-apps-mapping-via-Splunk-API/m-p/318539#M59535</link>
      <description>&lt;P&gt;Thanks jkat54&lt;BR /&gt;
but only 60% of sourcetypes are present in inputs.conf ;For example if you go into Splunk_TA_vmware, the sourcetypes are assigned within props.conf&lt;/P&gt;

&lt;P&gt;Is there similar search for "inputs", "props" , "transforms" etc? &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:36:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-sourcetypes-to-TA-apps-mapping-via-Splunk-API/m-p/318539#M59535</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2020-09-29T13:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get sourcetypes to TA/apps mapping via Splunk API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-sourcetypes-to-TA-apps-mapping-via-Splunk-API/m-p/318540#M59536</link>
      <description>&lt;P&gt;Ah. Found a way.  Combining conf-props, and inputs. Thanks jkat54 for the idea&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/configs/conf-props| stats count by eai:acl.app,title| search title!="source*"| rename title as sourcetype|eval endPoint="props"| append [| rest /services/configs/inputs| stats count by eai:acl.app,sourcetype| where sourcetype!=""| eval endPoint="inputs"]| stats count by eai:acl.app,sourcetype,endPoint
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Apr 2017 15:26:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-sourcetypes-to-TA-apps-mapping-via-Splunk-API/m-p/318540#M59536</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-04-11T15:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get sourcetypes to TA/apps mapping via Splunk API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-sourcetypes-to-TA-apps-mapping-via-Splunk-API/m-p/318541#M59537</link>
      <description>&lt;P&gt;You can change sourcetypes with props and transforms sure, but then they are dynamic based on regex, etc... So I don't know how to help you find those. &lt;/P&gt;

&lt;P&gt;Probably some combination of the data source and the sourcetype and then the app will work.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 22:06:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-sourcetypes-to-TA-apps-mapping-via-Splunk-API/m-p/318541#M59537</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-04-11T22:06:27Z</dc:date>
    </item>
  </channel>
</rss>

