<?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: Alter table column and search based on objecttype in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667451#M54601</link>
    <description>&lt;P&gt;Thanks for your reply .&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=dummyIndex    source IN ("/dummy/Source")"support request details"  |stats count | rename count as Re-ProcessRequest
| appendcols  [ search 
index=dummyIndex    source IN ("/dummy/Source") "input params" OR "sqs sent count" OR "Total messages published to SQS successfully" OR "unique objectIds" OR "data not found for Ids" OR "dataNotFoundIds"
 | rex "\"objectType\":\"(?&amp;lt;objectType&amp;gt;[^\"]+)"
  | rex "\"objectIdsCount\":\"(?&amp;lt;objectIdsCount&amp;gt;[^\"]+)"
   | rex "\"uniqObjectIdsCount\":\"(?&amp;lt;uniqObjectIdsCount&amp;gt;[^\"]+)"
  | rex "\"sqsSentCount\":\"(?&amp;lt;sqsSentCount&amp;gt;[^\"]+)"
    | rex "\"totalMessagesPublishedToSQS\":\"(?&amp;lt;totalMessagesPublishedToSQS&amp;gt;[^\"]+)" 
  | table objectType,objectIdsCount,sqsSentCount,totalMessagesPublishedToSQS,uniqObjectIdsCount   | addcoltotals labelfield=total label="Total" | tail 1| stats list(*) as * ]
  | appendcols  [ search 
  index=dummyIndex    source IN ("/dummy/source") "dataNotFoundIds" | spath output=payload path=dataNotFoundIds{} | spath input=_raw | stats count by payload  | addcoltotals labelfield=total label="Total" | tail 1 | fields - payload,total | rename count as datanotfoundbynewway]&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;While above is my query ,Let me first ask this: Can you please elaborate more on your statement&lt;BR /&gt;"&lt;SPAN&gt;if this is your issue, use table at the end of your search listing fields in the wanted order.&lt;/SPAN&gt;"&lt;BR /&gt;&lt;BR /&gt;I am looking to modify the above query such a way the column "datanotfoundbynewway" should appear at last.&lt;BR /&gt;&lt;BR /&gt;Actual: It always displayed as a second column&lt;BR /&gt;Expected : I wanted that column to appear as the last column .&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;# also how can i make use of stats in the above query instead of join&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2023 06:40:10 GMT</pubDate>
    <dc:creator>nithys</dc:creator>
    <dc:date>2023-11-06T06:40:10Z</dc:date>
    <item>
      <title>Alter table column and search based on objecttype</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667442#M54595</link>
      <description>&lt;P&gt;Hi Team,&lt;BR /&gt;I have a table which has counts for these attributes Re-ProcessRequest count,objectType,objectIdsCount,uniqObjectIdsCount,sqsSentCount,dataNotFoundIds&amp;nbsp;&lt;BR /&gt;1.How can i make table column arrange as my needs,currently dataNotFoundIds shows in second coluld ,,,rather i want to display in last column.similary want to do for other columns too?&lt;BR /&gt;2.How can i filter based on the objecttype and do the addcolumntotal and gisplay total count?&lt;BR /&gt;index="" source IN ""&amp;nbsp; &amp;nbsp;"support request details" |stats count | rename count as Re-ProcessRequest&lt;BR /&gt;| join left [ search&lt;BR /&gt;index="" source IN ""&amp;nbsp; "input params" OR "sqs sent count" OR "Total messages published to SQS successfully" OR "unique objectIds" OR "data not found for Ids"&lt;BR /&gt;| rex "\"objectType\":\"(?&amp;lt;objectType&amp;gt;[^\"]+)"&lt;BR /&gt;| rex "\"objectIdsCount\":\"(?&amp;lt;objectIdsCount&amp;gt;[^\"]+)"&lt;BR /&gt;| rex "\"uniqObjectIdsCount\":\"(?&amp;lt;uniqObjectIdsCount&amp;gt;[^\"]+)"&lt;BR /&gt;| rex "\"sqsSentCount\":\"(?&amp;lt;sqsSentCount&amp;gt;[^\"]+)"&lt;BR /&gt;| rex "\"dataNotFoundIds\":\"(?&amp;lt;dataNotFoundIds&amp;gt;[^\"]+)"&lt;BR /&gt;| rex "\"totalMessagesPublishedToSQS\":\"(?&amp;lt;totalMessagesPublishedToSQS&amp;gt;[^\"]+)"&lt;BR /&gt;| table objectType,objectIdsCount,sqsSentCount,totalMessagesPublishedToSQS,uniqObjectIdsCount,dataNotFoundIds | addcoltotals labelfield=total label="Total" | tail 1| stats list(*) as * ]&lt;BR /&gt;| join [ search&lt;BR /&gt;index=""source IN "" "dataNotFoundIds" | spath output=payload path=dataNotFoundIds{} | spath input=_raw | stats count by payload | addcoltotals labelfield=total label="Total" | tail 1 | fields - payload,total | rename count as datanotfound]&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-05 at 9.12.52 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27949i7B6EC3508C7675FB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-11-05 at 9.12.52 PM.png" alt="Screenshot 2023-11-05 at 9.12.52 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 05:17:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667442#M54595</guid>
      <dc:creator>nithys</dc:creator>
      <dc:date>2023-11-06T05:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Alter table column and search based on objecttype</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667443#M54596</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/260549"&gt;@nithys&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Let meunderstand: your issue is the fields order at the end of your search?&lt;/P&gt;&lt;P&gt;if this is your issue, use table at the end of your search listing fields in the wanted order.&lt;/P&gt;&lt;P&gt;About the filter, you can add a search command after the objectType extraction.&lt;/P&gt;&lt;P&gt;At least one hint: try to avoid to use join command: Splunk isn't a database and join command is very slow and resource consuming! in Community you can find many sampleas about replace join with stats.&lt;/P&gt;&lt;P&gt;I could be more detailes. if you could share your search using the Insert/Edit Code Sample button (&amp;lt;&amp;gt;) because the search parameters aren't clear.&lt;/P&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>Mon, 06 Nov 2023 06:00:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667443#M54596</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-11-06T06:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Alter table column and search based on objecttype</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667451#M54601</link>
      <description>&lt;P&gt;Thanks for your reply .&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=dummyIndex    source IN ("/dummy/Source")"support request details"  |stats count | rename count as Re-ProcessRequest
| appendcols  [ search 
index=dummyIndex    source IN ("/dummy/Source") "input params" OR "sqs sent count" OR "Total messages published to SQS successfully" OR "unique objectIds" OR "data not found for Ids" OR "dataNotFoundIds"
 | rex "\"objectType\":\"(?&amp;lt;objectType&amp;gt;[^\"]+)"
  | rex "\"objectIdsCount\":\"(?&amp;lt;objectIdsCount&amp;gt;[^\"]+)"
   | rex "\"uniqObjectIdsCount\":\"(?&amp;lt;uniqObjectIdsCount&amp;gt;[^\"]+)"
  | rex "\"sqsSentCount\":\"(?&amp;lt;sqsSentCount&amp;gt;[^\"]+)"
    | rex "\"totalMessagesPublishedToSQS\":\"(?&amp;lt;totalMessagesPublishedToSQS&amp;gt;[^\"]+)" 
  | table objectType,objectIdsCount,sqsSentCount,totalMessagesPublishedToSQS,uniqObjectIdsCount   | addcoltotals labelfield=total label="Total" | tail 1| stats list(*) as * ]
  | appendcols  [ search 
  index=dummyIndex    source IN ("/dummy/source") "dataNotFoundIds" | spath output=payload path=dataNotFoundIds{} | spath input=_raw | stats count by payload  | addcoltotals labelfield=total label="Total" | tail 1 | fields - payload,total | rename count as datanotfoundbynewway]&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;While above is my query ,Let me first ask this: Can you please elaborate more on your statement&lt;BR /&gt;"&lt;SPAN&gt;if this is your issue, use table at the end of your search listing fields in the wanted order.&lt;/SPAN&gt;"&lt;BR /&gt;&lt;BR /&gt;I am looking to modify the above query such a way the column "datanotfoundbynewway" should appear at last.&lt;BR /&gt;&lt;BR /&gt;Actual: It always displayed as a second column&lt;BR /&gt;Expected : I wanted that column to appear as the last column .&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;# also how can i make use of stats in the above query instead of join&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 06:40:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667451#M54601</guid>
      <dc:creator>nithys</dc:creator>
      <dc:date>2023-11-06T06:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Alter table column and search based on objecttype</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667453#M54602</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-05 at 10.41.14 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27950iAA646E2DC83A2637/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-11-05 at 10.41.14 PM.png" alt="Screenshot 2023-11-05 at 10.41.14 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 06:42:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667453#M54602</guid>
      <dc:creator>nithys</dc:creator>
      <dc:date>2023-11-06T06:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Alter table column and search based on objecttype</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667456#M54603</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/260549"&gt;@nithys&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;at the ned of your search you can use the table command to define the order of fields in output, in your case:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| table field1 field2 field3 datanotfoundbynewway&lt;/LI-CODE&gt;&lt;P&gt;then you are using three very similar searches as subsearches: this isn't very efficient because every subsearch takes a CPU.&lt;/P&gt;&lt;P&gt;In you case you couls use something like this: (please adapt my approach to your requirement):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=dummyIndex    source IN ("/dummy/Source")("support request details" OR "input params" OR "sqs sent count" OR "Total messages published to SQS successfully" OR "unique objectIds" OR "data not found for Ids" OR "dataNotFoundIds" OR "dataNotFoundIds")
| rex "\"objectType\":\"(?&amp;lt;objectType&amp;gt;[^\"]+)"
| rex "\"objectIdsCount\":\"(?&amp;lt;objectIdsCount&amp;gt;[^\"]+)"
| rex "\"uniqObjectIdsCount\":\"(?&amp;lt;uniqObjectIdsCount&amp;gt;[^\"]+)"
| rex "\"sqsSentCount\":\"(?&amp;lt;sqsSentCount&amp;gt;[^\"]+)"
| rex "\"totalMessagesPublishedToSQS\":\"(?&amp;lt;totalMessagesPublishedToSQS&amp;gt;[^\"]+)" 
| spath output=payload path=dataNotFoundIds{} 
| rename dataNotFoundIds{}AS datanotfoundbynewway
| stats 
   values(objectType) AS objectType
   values(objectIdsCount) AS objectIdsCount
   values(sqsSentCount) AS sqsSentCount
   values(totalMessagesPublishedToSQS) AS totalMessagesPublishedToSQS
   values(uniqObjectIdsCount) AS uniqObjectIdsCount
   count AS Re-ProcessRequest
   values(datanotfoundbynewway) AS datanotfoundbynewway
| addcoltotals labelfield=total label="Total"
| table objectType objectIdsCount sqsSentCount totalMessagesPublishedToSQS uniqObjectIdsCount datanotfoundbynewway&lt;/LI-CODE&gt;&lt;P&gt;probably this search will not work as is, but see my approach.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 06:58:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667456#M54603</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-11-06T06:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Alter table column and search based on objecttype</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667632#M54611</link>
      <description>&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 04:38:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alter-table-column-and-search-based-on-objecttype/m-p/667632#M54611</guid>
      <dc:creator>nithys</dc:creator>
      <dc:date>2023-11-07T04:38:57Z</dc:date>
    </item>
  </channel>
</rss>

