<?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: SPlunk query in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748196#M118903</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/272456"&gt;@sverdhan&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Try below with clients,&lt;/P&gt;&lt;P&gt;| tstats count WHERE index=* by index sourcetype&lt;BR /&gt;| rex field=index max_match=0 "(?&amp;lt;clients&amp;gt;\w+)(?&amp;lt;sensitivity&amp;gt;_private|_public)"&lt;BR /&gt;| lookup appserverdomainmapping.csv clients OUTPUT NewIndex, Domain, Sourcetype&lt;BR /&gt;| eval NewIndex=NewIndex.sensitivity&lt;BR /&gt;| table clients, sensitivity, Domain, Sourcetype, NewIndex&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you do not need to add clients, and to just display lookup fields you can use appendcols&lt;/P&gt;&lt;P&gt;| tstats count WHERE index=* by index sourcetype&lt;BR /&gt;| rex field=index max_match=0 "(?&amp;lt;clients&amp;gt;\w+)(?&amp;lt;sensitivity&amp;gt;_private|_public)"&lt;BR /&gt;| appendcols [| inputlookup appserverdomainmapping.csv | fields Domain, Sourcetype, NewIndex]&lt;BR /&gt;| eval NewIndex=NewIndex.sensitivity&lt;BR /&gt;| table clients, sensitivity, Domain, Sourcetype, NewIndex&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prewin&lt;BR /&gt;Splunk Enthusiast | Always happy to help! If this answer helped you, please consider marking it as the solution or giving a Karma. Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jun 2025 08:25:22 GMT</pubDate>
    <dc:creator>PrewinThomas</dc:creator>
    <dc:date>2025-06-18T08:25:22Z</dc:date>
    <item>
      <title>SPlunk query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748104#M118885</link>
      <description>&lt;P&gt;Hello team ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me modify this query such that it is able to loop through all the values of the csv file :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Although it is able to give the clients and sensitivity of the selected sourcetype but in the results in the fields- Sourcetype Domain and NewIndex it is only giving the values of the first sourcetype- A4Server&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sverdhan_0-1750166500468.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/39390i8AE521CF71F32B42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sverdhan_0-1750166500468.png" alt="sverdhan_0-1750166500468.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Like for example over here the selected sourcetype is A4server but in the sourcetype it is giving A4ServerBeta&amp;nbsp; as it is not looping through the entire csv but only the first value&lt;/P&gt;&lt;P&gt;| tstats count WHERE index=* sourcetype=A4Server by index&amp;nbsp;&lt;BR /&gt;| rex field=index max_match=0 "(?&amp;lt;clients&amp;gt;\w+)(?&amp;lt;sensitivity&amp;gt;_private|_public)"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| table index, clients, sensitivity&lt;BR /&gt;| join type=left client [&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; | inputlookup appserverdomainmapping.csv&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; | table NewIndex, Domain, Sourcetype&lt;BR /&gt;]| eval NewIndex= NewIndex + sensitivity&lt;BR /&gt;| table clients, sensitivity, Domain, Sourcetype, NewIndex&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jun 2025 13:26:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748104#M118885</guid>
      <dc:creator>sverdhan</dc:creator>
      <dc:date>2025-06-17T13:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: SPlunk query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748105#M118886</link>
      <description>&lt;P&gt;A4server Beta is the first value so no matter what sourcetype i choose it is on;y giving the values of A4server Beta in sourcetype , newIndex an ddomain&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jun 2025 13:28:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748105#M118886</guid>
      <dc:creator>sverdhan</dc:creator>
      <dc:date>2025-06-17T13:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: SPlunk query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748109#M118887</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/272456"&gt;@sverdhan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;did you tried to use the lookup command (&lt;A href="https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/9.4/search-commands/lookup" target="_blank"&gt;https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/9.4/search-commands/lookup&lt;/A&gt;) instead of inputlookup in your search?&lt;/P&gt;&lt;P&gt;the lookup command is like a left join.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats count WHERE index=* sourcetype=A4Server by index 
| rex field=index max_match=0 "(?&amp;lt;clients&amp;gt;\w+)(?&amp;lt;sensitivity&amp;gt;_private|_public)"
| fields - count
| lookup appserverdomainmapping.csv client OUTPUT NewIndex, Domain, Sourcetype
| eval NewIndex= NewIndex.sensitivity
| table clients, sensitivity, Domain, Sourcetype, NewIndex&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jun 2025 13:37:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748109#M118887</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-06-17T13:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: SPlunk query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748171#M118891</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;, don't use join, that's the wrong way to do this, however, you are using the wrong field. Your rex statement is extracting the field called&amp;nbsp;&lt;STRONG&gt;clients&lt;/STRONG&gt; but your join is using &lt;STRONG&gt;client&lt;/STRONG&gt; (singular).&lt;/P&gt;&lt;P&gt;Please use the lookup way to do this, not join.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jun 2025 22:15:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748171#M118891</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-06-17T22:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: SPlunk query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748192#M118901</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;Giuseppe,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks much for your suggestion , bit the query is giving an error : Cannot find client in the source field client in the lookup table . Now, we cant add clients in th elookup table becaue that would complex things. CAn yiu please tell m eothe rways to do it maybe through join or something.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Much appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jun 2025 07:31:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748192#M118901</guid>
      <dc:creator>sverdhan</dc:creator>
      <dc:date>2025-06-18T07:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: SPlunk query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748196#M118903</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/272456"&gt;@sverdhan&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Try below with clients,&lt;/P&gt;&lt;P&gt;| tstats count WHERE index=* by index sourcetype&lt;BR /&gt;| rex field=index max_match=0 "(?&amp;lt;clients&amp;gt;\w+)(?&amp;lt;sensitivity&amp;gt;_private|_public)"&lt;BR /&gt;| lookup appserverdomainmapping.csv clients OUTPUT NewIndex, Domain, Sourcetype&lt;BR /&gt;| eval NewIndex=NewIndex.sensitivity&lt;BR /&gt;| table clients, sensitivity, Domain, Sourcetype, NewIndex&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you do not need to add clients, and to just display lookup fields you can use appendcols&lt;/P&gt;&lt;P&gt;| tstats count WHERE index=* by index sourcetype&lt;BR /&gt;| rex field=index max_match=0 "(?&amp;lt;clients&amp;gt;\w+)(?&amp;lt;sensitivity&amp;gt;_private|_public)"&lt;BR /&gt;| appendcols [| inputlookup appserverdomainmapping.csv | fields Domain, Sourcetype, NewIndex]&lt;BR /&gt;| eval NewIndex=NewIndex.sensitivity&lt;BR /&gt;| table clients, sensitivity, Domain, Sourcetype, NewIndex&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prewin&lt;BR /&gt;Splunk Enthusiast | Always happy to help! If this answer helped you, please consider marking it as the solution or giving a Karma. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jun 2025 08:25:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748196#M118903</guid>
      <dc:creator>PrewinThomas</dc:creator>
      <dc:date>2025-06-18T08:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: SPlunk query</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748218#M118907</link>
      <description>&lt;P&gt;Hello, this query seems to be working but the clients field is a multivalue field for some sourcetype ,so it results are spread out ,can you modify it ?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jun 2025 11:15:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SPlunk-query/m-p/748218#M118907</guid>
      <dc:creator>sverdhan</dc:creator>
      <dc:date>2025-06-18T11:15:09Z</dc:date>
    </item>
  </channel>
</rss>

