Activity Feed
- Got Karma for Is it possible to truncate data in an index eg. delete all events that are older than 60 days, and if how?. 07-19-2022 01:58 PM
- Got Karma for transaction calculate duration betweeen 2 events. 06-05-2020 12:48 AM
- Karma Re: Can I use an extracted date field as my _time for my time chart? for tom_frotscher. 06-05-2020 12:47 AM
- Got Karma for Re: Why am I getting error "Received unexpected 369295360 byte message!" connecting to TCP input using java client SDK on Splunk 6.2?. 06-05-2020 12:47 AM
- Karma Infinite loop when there are no results using JSON output for andras_kerekes. 06-05-2020 12:46 AM
- Karma Re: Splunk4JMX with Splunk version 6.0 Install and/or upgrade issues for Damien_Dallimor. 06-05-2020 12:46 AM
- Karma Re: Splunk for JMX for sdaniels. 06-05-2020 12:46 AM
- Karma Re: sum the number of events based on list of possible values for HiroshiSatoh. 06-05-2020 12:46 AM
- Karma Re: sum the number of events based on list of possible values for dariusz_kwasny. 06-05-2020 12:46 AM
- Karma Re: Flushing and writing to Socket using javasdk for Damien_Dallimor. 06-05-2020 12:46 AM
- Karma Re: REST API Modular Input for Damien_Dallimor. 06-05-2020 12:46 AM
- Karma Re: Using Single Value Decorations for rsennett_splunk. 06-05-2020 12:46 AM
- Karma Re: Extract JSON data within the logs ( JSON mixed with unstructured data) for renjith_nair. 06-05-2020 12:46 AM
- Got Karma for Re: multiple problems using Splunk java sdk 1.1.0 in weblogic 3.5.0. 06-05-2020 12:46 AM
- Got Karma for sum the number of events based on list of possible values. 06-05-2020 12:46 AM
- Posted Re: transaction calculate duration betweeen 2 events on Splunk Search. 07-12-2017 05:37 AM
- Posted Re: transaction calculate duration betweeen 2 events on Splunk Search. 07-12-2017 04:06 AM
- Posted Re: transaction calculate duration betweeen 2 events on Splunk Search. 07-12-2017 03:25 AM
- Posted Re: transaction calculate duration betweeen 2 events on Splunk Search. 07-12-2017 03:22 AM
- Posted transaction calculate duration betweeen 2 events on Splunk Search. 07-12-2017 02:16 AM
Topics I've Started
Subject | Karma | Author | Latest Post |
---|---|---|---|
1 | |||
0 | |||
0 | |||
0 | |||
0 | |||
0 | |||
0 | |||
0 | |||
0 | |||
0 |
07-12-2017
05:37 AM
Thanks !! I managed to get the last bits together
... View more
07-12-2017
04:06 AM
I actually need group with only 1 event to show up since this should indicate that something is missing/wrong.
But other that that the search seems to work when there is 2 events
... View more
07-12-2017
03:25 AM
So duration is only calculated if there is at most 1 event. When the transaction returns 2 duration is empty
... View more
07-12-2017
03:22 AM
then it's empty
... View more
07-12-2017
02:16 AM
1 Karma
I'm trying to use transactions to generate a timeline of events where the events are grouped by an eventId
I'm recieving up to 2 events as a START and a STOP event, and have to calculate the duration between them based on actualTime.
{
"action" : "START",
"source" : "AS_PLANNED",
"timestamp" : "2017-07-12T10:07:14.682+02:00",
"eventId" : "1366963140327",
"title" : "sadfasdfasdf",
"flowPublicationId" : "1366963137812",
"timeAllocationType" : "Segment of program",
"actualTime" : "2017-07-12T10:07:14.760+02:00",
"startTimeAnnounced" : "2017-07-12T10:05:00.000+02:00",
"startTimePlanned" : "2017-07-12T10:07:14.760+02:00",
"stopTimePlanned" : "2017-07-12T10:12:50.360+02:00",
"broadcastDate" : [ 2017, 7, 12 ],
"live" : false,
"quickReprise" : false,
"streamingLive" : false,
"streamingOD" : false,
"numberOfBlocks" : "1",
"blockPartNumber" : "1",
"blockId" : "1366963138813"
}
{
"action" : "STOP",
"source" : "AS_PLANNED",
"timestamp" : "2017-07-12T10:12:50.310+02:00",
"eventId" : "1366963140327",
"title" : "yyyyyy",
"flowPublicationId" : "1366963137812",
"timeAllocationType" : "Segment of program",
"actualTime" : "2017-07-12T10:12:50.360+02:00",
"startTimeAnnounced" : "2017-07-12T10:05:00.000+02:00",
"startTimePlanned" : "2017-07-12T10:07:14.760+02:00",
"stopTimePlanned" : "2017-07-12T10:12:50.360+02:00",
"broadcastDate" : [ 2017, 7, 12 ],
"live" : false,
"quickReprise" : false,
"streamingLive" : false,
"streamingOD" : false,
"numberOfBlocks" : "1",
"blockPartNumber" : "1",
"blockId" : "1366963138813"
}
The query I'm using ->
index="morpheus"
| transaction eventId
| eval start=if(action=="START",actualTime,startTimePlanned)
| eval stop=if(action=="STOP",actualTime,stopTimePlanned)
| eval duration=(strptime(stop,"%Y-%m-%dT%H:%M:%S,%3N") - strptime(start,"%Y-%m-%dT%H:%M:%S,%3N"))
| table actualTime, action, title, start, stop, duration
But it seems that I'm not getting the duration correctly calculated.
... View more
- Tags:
- duration
- transactions
07-11-2017
11:07 PM
Works fine. Thanks
... View more
07-11-2017
04:09 AM
Hi
I'm trying to break json events comming from tcp input into seperate events.
{
"action" : "STOP",
"source" : "AS_PLANNED",
"timestamp" : "2017-03-24T08:29:59.977+01:00",
"productionNumber" : "14801720125",
"productionType" : "Radio",
"eventId" : "1179469773327",
"title" : "Some title",
"flowPublicationId" : "1179469742812",
"channelPresentationCode" : "xx",
"channelPresentationName" : "xxyy",
"timeAllocationType" : "Segment of program",
"actualTime" : "2017-03-24T08:30:00.000+01:00",
"startTimeAnnounced" : "2017-03-24T08:06:00.000+01:00",
"startTimePlanned" : "2017-03-24T08:06:00.000+01:00",
"stopTimePlanned" : "2017-03-24T08:30:00.000+01:00",
"broadcastDate" : "2017-03-24",
"live" : false,
"quickReprise" : false,
"streamingLive" : false,
"streamingOD" : true,
"streamingDestination" : " (WEBCMS)",
"numberOfBlocks" : "8",
"blockPartNumber" : "5",
"blockId" : "1179469768813"
}
Note that the json is pretty printed with spaces and linebreaks.
It works fine if I ommit the spaces and linebreaks with the default json sourcetype, but with the pretty printet version the event get's split into several events.
I have figured out I have to create a custom sourcetype and use a custom LINE_BREAKER as stated here https://answers.splunk.com/answers/171197/how-to-get-two-lines-of-json-to-break-as-two-event.html.
But I was not able to find the magic rex to ommit spaces and linebreaks.
... View more
09-09-2016
03:31 AM
Will answer this my self.
I just did
index="surveillance-status" source="rest://drip status" OR source="rest://drip-status2" | chart count by source, status
... View more
09-08-2016
11:16 PM
I have the following search
index="surveillance-status" source="rest://drip status" OR source="rest://drip-status2" | stats count by source, status
It gives me 4 rows with the fields source, status and a count for each, since the status can be either OK or ERROR
How can i turn this into a pie chart that shows a slice fore each source by status
... View more
- Tags:
- splunk-enterprise
10-30-2014
12:28 PM
1 Karma
Ahh. you are right. Just took a step deeper. The connection is actually done using http against the management port using the Service.connect. Later the service instance can be used to get a tcp socket connection using the open method ->
public Socket open(int port) throws IOException {
return new Socket(this.host, port);
}
Just forgot
... View more
10-30-2014
11:49 AM
sure
https://github.com/apache/camel/blob/master/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConnectionFactory.java#L126
... View more
10-30-2014
11:38 AM
I don't think thats correct. Look at the Service class this is a general class for connecting to Splunk using http(s) at the port you configured in the args map.
This has been working fine on previous versions of Splunk.
... View more
10-30-2014
11:16 AM
It's a tcp receiver port opened using the console -> Settings » Forwarding and receiving » Receive data » add new.
... View more
10-28-2014
11:16 AM
I'm testing the new Splunk version using the java client sdk, and are seeing problems connecting to a tcp receiver port 9997.
When connecting i'm using a serviceargs map with the values {host=localhost, port=9997, scheme=https, username=admin, password=password}
When doing Service.connect(args) i'm getting an error
could not connect to Splunk Server @ localhost:9997 - java.lang.RuntimeException: Remote host closed connection during handshake
From the splunkd.log there are log entries ->
10-28-2014 19:03:49.815 +0100 ERROR TcpInputProc - Message rejected. Received unexpected 369295360 byte message! from src=127.0.0.1:55247. Maximum message allowed: 67108864. (::)
There is no problem when using earlier versions of Splunk eg. 5.3
Best,
Preben
... View more
05-29-2014
01:01 AM
Hi Kelvin
Afair I used the json parser instead to bypass wls xml libs in classpath. You can see some of the code here https://github.com/apache/camel/blob/master/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/support/SplunkDataReader.java#L276
where the json reader is used.
... View more
05-27-2014
02:53 AM
yeah - was fixed in the splunk sdk afair
... View more
12-09-2013
06:02 AM
I tripled the ram on the box - lets see if this helps splunkd from being killed by linux.
I still see the warn logs
12-09-2013 14:44:59.219 +0100 WARN HttpListener - HTTP active connections down to 330, unthrottling
Any hints on the reason for this ??
Best,
Preben
... View more
12-09-2013
04:12 AM
There is no crash log, and the only resent error I can find in splunkd.log is
12-04-2013 19:00:36.639 +0100 ERROR ProcessRunner - helper process seems to have died (child killed by signal 9: Killed)!
Other that that there is only the WARN's that seems a bit worrying.
best,
Preben
... View more
12-08-2013
11:18 PM
Splunkd has crashed a couple of times now.
The only thing I see in splunkd.log is some log WARNS
eg.
12-09-2013 07:55:09.879 +0100 WARN HttpListener - Socket error from 10.101.11.1
02 while accessing /services/data/indexes: Broken pipe
and a lot of ->
12-09-2013 08:03:17.651 +0100 WARN HttpListener - HTTP active connections down to 330, unthrottling
Is there some configuration that needs to be set different - or ??
... View more
11-25-2013
10:41 AM
Hi Damien
That looks doable, but with a couple of pitfalls since loops that contain Thread.sleeps have to be guarded by the possibility to break the loop when you want to stop the search thread from outside.
Somehow I feel that the SDK should take care of this eg. by fixing the isReady method so it returns when the stream is ready (there is at least 1 preview event, or there is no events in the current time window).
... View more
11-24-2013
08:45 AM
Hi
When using the realtime api to search is have noticed that unless you do a extra Thread.Sleep(xxx);
after the job.isReady loop you get an empty stream.
I use the com.splunk.examples.search_realtime.Program as an example.
.....
while (!job.isReady()) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// You shouldn't ever get here.
}
}
// extra sleep to make sure Splunk returns a event stream.
try {
Thread.sleep(2000);
} catch (InterruptedException e1) {
}
In another process I continuously ingest tweet events into an index, but they are not showing up when running the Program unless the extra Thread.sleep for some secs.
I'm using the latest 1.2.1.0 sdk to test. and Splunk 6 + max osx
... View more
- Tags:
- java
11-18-2013
12:20 PM
Thanks - yes indeed only the css is necessary + restart of splunkweb
... View more
11-16-2013
11:42 AM
How can I make use of the rangemap when my search returns statis values like [OK or ERROR or WARN] and display a single value with a icon for each ERROR = server, OK = low and WARN = guarded.
Somehow I have to translate the ERROR ect. to a number to make use of rangemap i guess ?
The search = index=something | sort - _time
The search returns a status and a timestamp where only the resent value should count.
Normally the single value works like this :
<single>
<searchString>| stats count as value | eval value = 550 | rangemap field=value none=0-99 low=100-199 guarded=200-299 elevated=300-399 high=400-499 severe=500-599 default=none</searchString>
<earliestTime>-15m</earliestTime>
<latestTime>now</latestTime>
<option name="classField">range</option>
<option name="field">value</option>
</single>
... View more
- Tags:
- dashboard
- singlevalue
11-16-2013
11:18 AM
I was looking at the Splunk 6 Dashboard Example App. and from what I figured out by now is.
When you create a new app you have to copy
dashboard.css
dashboard.js
single_decorations.css
from simple_xml_examples app home.
to the $SPLUNK_HOME/etc/apps/{appname}/appserver/static/
The directory is not initially created so you have to do that yourself.
Edit the dashboard.js file and set the var APP = {appname};
Create a dashboard + panel and have the dashboard load the css =
... View more