Splunk Search

Not using chartTime or bucket -- I want this search to display the trend for daily, week and monthly in signal query

jw44250
New Member

Mongo Collection Data : -

Id : 1
StartDate : some date
EndDate : Some Date

    X :
    Foo : “foo1’
    Count : 10

Id : 2
StartDate : some date
EndDate : Some Date

X :
    Foo : “foo2’
    Count : 5       

Id : 3
StartDate : some date
EndDate : Some Date

X :
    bar : “bar1’
    Count : 20
0 Karma

woodcock
Esteemed Legend

I do not understand the way that you have presented your data. I also do not understand the desire. It helps greatly if you present sample raw events and desired output mockup.

0 Karma

Sukisen1981
Champion

hi,

not clear what you want. but append cols will only work if you have values in all the fields that you are basing your append cols on.
for example:

| appendcols StatDate [search.....]
unless the start dates are common across all the sub searches you are using the appendcols will not work.

the mongodb JSON you are consuming for id1,2 & 3 are they in the same index?
Consider using stats command rather than append or join

0 Karma

jw44250
New Member

This is nearly what i m looking for

https://answers.splunk.com/answers/204291/use-of-count-by-date-in-metadata-typehosts.html

host 12/04/14 12/05/14 12/06/14 ...
A 5 10 ...
B 27 12 ...
C 48 40 ...
D 95 25 ...

0 Karma

jw44250
New Member

the mongodb JSON you are consuming for id1,2 & 3 are they in the same index? Yes.

I have "| appendcols StatDate [search.....] but my result is over the places.

I'm going to try below SPLunk Query
source="PS_VM_Config" VMCDMedia="True" earliest=-72h | stats count(VMName) AS ConnectedDays, Values(VCenter) AS VCenter BY VMName | where ConnectedDays > 2 | join [search source="PS_VM_Config" VMCDMedia="True" earliest=-24h] | table VMName VCenter

I am searching for word foo & bar on daily basis, weekly, monthly - and my output should be in
Daily Result
Monday
Foo appeared 1 times
Bar appreard 2

Tuseday
Foo appeared 1 times
Bar appreard 2

.............

Weekly
Foo appeared 10 times
Bar appreard 0

Week 1
Foo appeared 10 times
Bar appreard 0

Week 2
Bar appreard 50 Time0

Monthly Result
Foo appeared 10 times
Bar appreard 0

0 Karma

jw44250
New Member

i have used append Columns but by result is proprly displayed

StartDate EndDate Bar . count1 count2
someDate some date . 20

StartDate EndDate Bar . count1 count2
someDate some date . 0

0 Karma

jw44250
New Member

only same index

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...